reading DOM through javascript

Discussion in 'Javascript' started by Jay, Nov 16, 2007.

  1. Jay

    Jay Guest

    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
    Jay, Nov 16, 2007
    #1
    1. Advertising

  2. Jay wrote:
    > 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">
    ...
    </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
    --
    Anyone who slaps a 'this page is best viewed with Browser X' label on
    a Web page appears to be yearning for the bad old days, before the Web,
    when you had very little chance of reading a document written on another
    computer, another word processor, or another network. -- Tim Berners-Lee
    Thomas 'PointedEars' Lahn, Nov 16, 2007
    #2
    1. Advertising

  3. Jay

    Jay Guest

    > > 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.
    Jay, Nov 16, 2007
    #3
  4. Jay meinte:
    >>> 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 :) ...


    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




    --
    http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://www.licht-blick.at ::: Forum für Multivisionsvorträge
    http://www.image2d.com ::: Bildagentur für den alpinen Raum
    Gregor Kofler, Nov 16, 2007
    #4
  5. Jay

    Jay Guest

    On Nov 16, 2:20 pm, Gregor Kofler <> wrote:
    > Jay meinte:
    >
    > >>> 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 :) ...

    >
    > 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
    >
    > --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
    Jay, Nov 16, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thorsten Meininger
    Replies:
    0
    Views:
    439
    Thorsten Meininger
    Jul 28, 2004
  2. Thorsten Meininger
    Replies:
    0
    Views:
    507
    Thorsten Meininger
    Jul 28, 2004
  3. mike
    Replies:
    1
    Views:
    1,137
    Martin Honnen
    Nov 20, 2004
  4. Replies:
    0
    Views:
    548
  5. Safalra
    Replies:
    2
    Views:
    133
    -Lost
    Mar 30, 2007
Loading...

Share This Page