Divs not accessible
I'm creating a CMS using Ajax.
So I'm updating the page all the time, but there's a problem.
I'm loading a module into a div.
this div will be filled using an Ajax function.
the update appears on the screen.
the contents of the div should then be:
another function should fill this div.
<div id="text"> </div>
and that's the problem. the div cannot be found, because it just doesn't exist in the source.
Is there a solution to this problem?
Hope someone can help me!
Same problem here too...
I am having a similiar problem where I have a DIV InnerHTML loaded from an AJAX call with a form. The HTML DOM does not recognize any of my form objects after they are returned to the page.
The issue seems to be that the DOM only generates the object model based on the original page loading. My research continues, however, it seems the resolution centers around having to "update" the DOM with the objects that are added to the page through an AJAX response.
someone told me I should use createElement instead of innerHTML. My problem is solved somehow, but i didn't use createElement. I've just rewritten my code in another way.
but this is what someone gave me about the createElement code:
it's not much, but i hope it helps!
var moduleDiv = document.getElementById('module');
var textDiv = document.createElement('div');
var imgImage = document.createElement('img');
imgImage.src = 'images/textHeader.png';