reading DOM through javascript

J

Jay

Hello all,

I have created a simple form in html and have a onSubmit() javascript
function that is called when that form is submitted. The form is an
authentication form and it has to be a post. What I want to be able to
do, if it is even possible, is to get just the html DOM from the page
after authentication has occurred and for the browser not to go to the
page specified in the "action" attribute of the form but stay in the
current page. So after users click on submit authentication would take
place in the background and I should be able to parse through the html
of the entry page.

Is this even possible to do with a form and javascript, or do I have
to do something completely different. One restriction is that I can't
use AJAX.

Thanks for any help,

..J
 
T

Thomas 'PointedEars' Lahn

Jay said:
I have created a simple form in html and have a onSubmit() javascript
function that is called when that form is submitted. The form is an
authentication form and it has to be a post. What I want to be able to
do, if it is even possible, is to get just the html DOM from the page
after authentication has occurred

HTML is an acronym, and the DOM is an API. What are you really trying to do?
and for the browser not to go to the page specified in the "action"
attribute of the form but stay in the current page.

(The misconception of people thinking of markup documents as pages and the
viewport of a user agent as a book never ceases to amaze me.)

The "browser" has to "go" to the "page" specified in the `action' attribute
or there would be no data transmission. But the response message that the
server sends in reply to the request caused by the form submission can be
displayed in another document container. IOW, submit the form to a frame or
iframe.

<form action="login" target="my_iframe">
...
</form>

<iframe ... name="my_iframe">
...
So after users click on submit authentication would take
place in the background and I should be able to parse through the html
of the entry page.

And what would the "entry page" be?


PointedEars
 
J

Jay

HTML is an acronym, and the DOM is an API.
No shit Sherlock.

Try reading the post and you can figure out what they are trying to do.

What never ceases to amaze me is your inability to comprehend and
process simple things.

Wow, those were the same responses I would have given, you beat me to
it :) ...
The "browser" has to "go" to the "page" specified in the `action' attribute
or there would be no data transmission. But the response message that the
server sends in reply to the request caused by the form submission can be
displayed in another document container. IOW, submit the form to a frame or
iframe.

<form action="login" target="my_iframe">
...
</form>

<iframe ... name="my_iframe">
...
</iframe>

Using iframe seems to work, i can't believe i didn't think of that
before...

Thanks for your help.
 
G

Gregor Kofler

Jay meinte:
Wow, those were the same responses I would have given, you beat me to
it :) ...
and...

Using iframe seems to work, i can't believe i didn't think of that
before...
Thanks for your help.

What do you prefer - getting help in a not-so-nice response, or getting
nice responses with no useful information?

Your quoting is broken.

Gregor
 
J

Jay

Jay meinte:



What do you prefer - getting help in a not-so-nice response, or getting
nice responses with no useful information?

Your quoting is broken.

Gregor

--http://www.gregorkofler.at::: Landschafts- und Reisefotografiehttp://www..licht-blick.at ::: Forum für Multivisionsvorträgehttp://www.image2d.com::: Bildagentur für den alpinen Raum

I don't know about you but I'd rather have best of both worlds, nice
responses AND useful information. But I guess that's too much to ask
for.

.J
 

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

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top