Recently, I have been attempting to pick up AJAX and discovered a slight problem with innerHTML..
I have
then ..
The content shows up but when I view source, the <div id='container'> </div> tag shows up as EMPTY, does not input the new content, although the browser displays the ajax reponse in the div, to the user... I assume that innerHTML displays the content directly to the screen but does not update the content between the <div> </div> .. which brings up another problem as my javascript for ajax-in-place-editor references some <div> which was supposed to show up between the <div id='container'> </div> tag ...
What should have been displayed:
eg.
instead, it is showing
as before, and is EMPTY in between those tags (although the browser shows
hello1,hello2,h ello3) but my javascript breaks here, since it cannot find <div id='header_1'> ... and 2, and 3, and so forth..
Any idea how I could solve this problem?
Any help is appreciated! Thanks!
I have
Code:
<div id='container'></div>
Code:
$('container').innerHTML=req.responseText;
What should have been displayed:
eg.
Code:
<div id='container'> <div id='header_1'>hello1</div> <div id='header_2'>hello2</div> <div id='header_3'>hello3</div> </div>
Code:
<div id='container'></div>
hello1,hello2,h ello3) but my javascript breaks here, since it cannot find <div id='header_1'> ... and 2, and 3, and so forth..
Any idea how I could solve this problem?
Any help is appreciated! Thanks!
Comment