Retrieve Object from dinamically loaded HTML

Discussion in 'Javascript' started by Fabio Cavassini, Dec 13, 2005.

  1. I have this code that load HTML tags (no including <html> or <body>)
    into a DIV dinamically...

    after correctly retrieving the HTML, I assign it to my DIV Container

    document.getElementById(containerid).innerHTML=page_request.responseText

    now from main page....I need to get a reference to an Object (a
    textbox) contained in the dinamically loaded HTML

    Once in my main document this, doesn't works:
    document.getElementById(containerid)

    The objects that I loaded dinamically, are part of the Main Document or
    not?

    How can I access this objects from my main page?

    Best Regards
    Fabio Cavassini
    http://www.pldsa.com
     
    Fabio Cavassini, Dec 13, 2005
    #1
    1. Advertising

  2. Fabio Cavassini wrote:

    > after correctly retrieving the HTML, I assign it to my DIV Container
    >
    > document.getElementById(containerid).innerHTML=page_request.responseText
    >
    > now from main page....I need to get a reference to an Object (a
    > textbox) contained in the dinamically loaded HTML
    >
    > Once in my main document this, doesn't works:
    > document.getElementById(containerid)


    What happens exactly, does getElementById return null, do you get any
    error mesage, if so which one?
    Make sure the inserted HTML does not contain an id attribute value which
    already exists in the document.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Dec 13, 2005
    #2
    1. Advertising

  3. Ouch... It actually works... the error was in other side.

    Thank you

    Best Regards
    Fabio
     
    Fabio Cavassini, Dec 14, 2005
    #3
    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. Marcelo Birnbach [MS]
    Replies:
    0
    Views:
    3,330
    Marcelo Birnbach [MS]
    Jun 28, 2003
  2. Udo Corban
    Replies:
    0
    Views:
    3,853
    Udo Corban
    Jan 23, 2004
  3. Replies:
    8
    Views:
    334
    Tom Anderson
    May 14, 2008
  4. Steve Litt
    Replies:
    2
    Views:
    188
    Dejan Dimic
    Sep 29, 2008
  5. Replies:
    0
    Views:
    71
Loading...

Share This Page