Hi
when i m trying to execute my ajax code using a link to display datas from another page named second.php.,
i got an error when the page loads in "ie"., which runs perfectly in firefox.,
here is my code
[code=php]
<table id="idname">
.............
first page contents
............... ..
<a onclick="call_s ec(<? echo $i;?>)">second</a></table>
[/code]
when the page loads i get an error "Error: 'document.getEl ementById(...)' is null or not an object"
but works well with firefox.,
could anyone help me.,
its very urgent.,
thanks
when i m trying to execute my ajax code using a link to display datas from another page named second.php.,
i got an error when the page loads in "ie"., which runs perfectly in firefox.,
here is my code
Code:
<script type="text/javascript"> var i; function httprequest(i) { var xmlhttp; try { xmlhttp=new XMLHttpRequest(); } catch(e) { try { xmlhttp=new Activexobject("Msxml2.XMLHTTP"); } catch(e) { try { xmlhttp=new Activexobject("MICROSOFT.XMLHTTP") } catch(e) { alert("ur browser doesnot support Ajax"); return false; } } } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { obj = document.getElementById( "idname" ); obj.innerHTML = xmlhttp.responseText; getBufferText(); } } xmlhttp.open("GET", "second.php?i="+i,true); xmlhttp.send(null); } function call_sec(i) { httprequest(i) } </script>
<table id="idname">
.............
first page contents
............... ..
<a onclick="call_s ec(<? echo $i;?>)">second</a></table>
[/code]
when the page loads i get an error "Error: 'document.getEl ementById(...)' is null or not an object"
but works well with firefox.,
could anyone help me.,
its very urgent.,
thanks
Comment