Retrieve Object from dinamically loaded HTML

F

Fabio Cavassini

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
 
M

Martin Honnen

Fabio said:
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.
 
F

Fabio Cavassini

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

Thank you

Best Regards
Fabio
 

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,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top