Hi all, I try to execute a page that use AJAX to show some HTML codes in it, after selecting an option.
I try to use ajax to encrease the speed of the page. But with IE7 and IE6 I encountered some problem.
First of all I try to fill a div tag with the innerHTML method, but with IE family it doesn't work.
I have to fill a div with something like "<p>This test show a text under a line in the div TAG</p>", with something like "TEST", everything working!So, as I read in some forum, the problem resides in the space character, passed ad responsetext from a php file.
I have this text as a response calling a php file, very easy, but if finally I got it, I can extend this procedure to a more complex page.
Httpobject is a XMLHTTPrequest object
tha page html is like:
..........omiss is..........
[HTML]<div id="mydiv">
</div>[/HTML]
......omissis.. ....
this is the javascript
...omissis....
[CODE=javascript]d=document.getE lementById('myd iv');
d.innerHTML=htt pObject.respons eText;[/CODE]
...omissis....
and it's work with firefox and safari, but not in IE family browser
I also try this javascript:
.......omissis. .....
[CODE=javascript]d=document.getE lementById('myd iv');
var text=document.c reateTextNode(h ttpObject.respo nse);
d.appendChild(t ext);[/CODE]
this one doesn't work, too.
Please someone can help me to resolve this problem, I spend the last entire night on it, without any success :-(
thanks a lot in advance
I try to use ajax to encrease the speed of the page. But with IE7 and IE6 I encountered some problem.
First of all I try to fill a div tag with the innerHTML method, but with IE family it doesn't work.
I have to fill a div with something like "<p>This test show a text under a line in the div TAG</p>", with something like "TEST", everything working!So, as I read in some forum, the problem resides in the space character, passed ad responsetext from a php file.
I have this text as a response calling a php file, very easy, but if finally I got it, I can extend this procedure to a more complex page.
Httpobject is a XMLHTTPrequest object
tha page html is like:
..........omiss is..........
[HTML]<div id="mydiv">
</div>[/HTML]
......omissis.. ....
this is the javascript
...omissis....
[CODE=javascript]d=document.getE lementById('myd iv');
d.innerHTML=htt pObject.respons eText;[/CODE]
...omissis....
and it's work with firefox and safari, but not in IE family browser
I also try this javascript:
.......omissis. .....
[CODE=javascript]d=document.getE lementById('myd iv');
var text=document.c reateTextNode(h ttpObject.respo nse);
d.appendChild(t ext);[/CODE]
this one doesn't work, too.
Please someone can help me to resolve this problem, I spend the last entire night on it, without any success :-(
thanks a lot in advance
Comment