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:
<div id="text"> </div>
another function should fill this 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!
04-18-2007, 05:08 PM
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.
04-19-2007, 03:56 AM
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:
var moduleDiv = document.getElementById('module');
var textDiv = document.createElement('div');
var imgImage = document.createElement('img');
imgImage.src = 'images/textHeader.png';