Parsing information from a page opened by a form

J

JustASymbol

I'm not sure if this is possible, but if someone has an idea of how to
do this or a link that can point me in the right direction, it would be
much appreciated.

I have a very simple form with text fields for a username and password.
When the user clicks the login button, it uses submit() to send the
information to a validation script and then opens a new window with
some information that I would like to be able to parse through.

I'm new to JavaScript so I'm not sure how to do this. Basically,
instead of the new window opening after a successful login, I would
like to prevent the user from even seeing the new page and instead
pulling the page's XHTML information into some sort of variable that I
can parse through and pull a few numbers out of. The part im having
difficulty with is getting the XHTML back into my javascript for
parsing.

Thanks in advance
 
V

VK

I'm not sure if this is possible, but if someone has an idea of how to
do this or a link that can point me in the right direction, it would be
much appreciated.

I have a very simple form with text fields for a username and password.
When the user clicks the login button, it uses submit() to send the
information to a validation script and then opens a new window with
some information that I would like to be able to parse through.

I'm new to JavaScript so I'm not sure how to do this. Basically,
instead of the new window opening after a successful login, I would
like to prevent the user from even seeing the new page and instead
pulling the page's XHTML information into some sort of variable that I
can parse through and pull a few numbers out of. The part im having
difficulty with is getting the XHTML back into my javascript for
parsing.

Are both "login page" and "response page" in the same domain?
 
J

JustASymbol

Sorry for not clarifying. The login script and the response page are
both in the same domain. However, the simple login page that I created
is not in that domain.

Also, thanks for the suggested search I understand why that question
would be important.

So now, I guess my question is: is there anyway at all for me to just
simply "search" through a page's text without actually opening it in a
new window that a user would see?

What I need to do in a nutshell is call a login script on another
server which would log the user in and normally display a new page on
the same server with some information on it. This works fine so far.
Instead of opening this new page though, I just want to take a few
numbers from one of the page's <div> tags and then just do something
like save them in a variable or write them to the screen.

Thanks for your suggestions so far.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top