HTML (Dynamically added) not visible to document or JQuery
Hi
For the company I work for, I have some HTML being generated and inserted via AJAX (I think).
Problem is that the new elements cannot be found via document.getElementByID nor JQuery $("#nameofnewelement").
Browser is showing them though.
Is there a way to refresh the document and/or JQuery?
Regards
Vince
Re: HTML (Dynamically added) not visible to document or JQuery
As long as the DOM is being updated properly, and if it's being displayed, it sounds like it is, then the only reasons I can think of that the getElementByID or JQuery wouldn't work is because they are executing before the DOM is updated, or the ID isn't correct.
-tg
Re: HTML (Dynamically added) not visible to document or JQuery
If the are inserting to asp.net then if they are using master pages, then there is a chance you won't get the elements that easy.
Again, if it is asp.net
Re: HTML (Dynamically added) not visible to document or JQuery
Remember that ID's must be unique on a page. You can certainly put up two elements with the same ID - but don't expect them to work.
btw - the jQuery doesn't need to be updated - it's looking at the DOM tree using standard JavaScript functions.
Re: HTML (Dynamically added) not visible to document or JQuery
Remember that ID's must be unique on a page. You can certainly put up two elements with the same ID - but don't expect them to work.
btw - the jQuery doesn't need to be updated - it's looking at the DOM tree using standard JavaScript functions.
Re: HTML (Dynamically added) not visible to document or JQuery
Its on Tomcat (Jsp).
It looks like the browser is working, but js scripts and the new dom elements cannot be seen after the ajax call. Which is strange. I'll keep going, thanks for the suggestions