balaganesh.k89 Posted July 6, 2009 Share Posted July 6, 2009 this java script ajax function working well in IE.. but prblem in Mozilla the mma function always starting first ... <script language="javascript"> function getHTTPObject() { if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { alert("Your browser does not support AJAX."); return null; } } function hsc(va2) { var zs,zs1,y1,y2,zz,z1,y3; zs=va2; y1=document.getElementById(zs).src; y2=y1.match("minus_symbol.gif"); y3=y1.match("plus_symbol.gif"); zs1= zs.split("img"); zz=zs1[1]; if(y2=="minus_symbol.gif") { z1='ct='+zz; b="img"+zz; url ="get_catname.php"; objXMLHTTP1 = getHTTPObject(); objXMLHTTP1.open("POST",url,true); objXMLHTTP1.onreadystatechange = stateChanged; objXMLHTTP1.setRequestHeader('content-type','application/x-www-form-urlencoded'); objXMLHTTP1.send(z1); function stateChanged() { if (objXMLHTTP1.readyState==4) { document.getElementById(zz).innerHTML=""; document.getElementById(zz).innerHTML=objXMLHTTP1.responseText; document.getElementById(b).src="images/plus_symbol.gif"; } } } if(y3=="plus_symbol.gif") { mma(); } function mma() { b="img"+zz; z='ct='+zz; url ="get_subcategname.php"; objXMLHTTP = getHTTPObject(); objXMLHTTP.open("POST",url,true); objXMLHTTP.onreadystatechange = stateChanged; objXMLHTTP.setRequestHeader('content-type','application/x-www-form-urlencoded'); objXMLHTTP.send(z); function stateChanged() { if (objXMLHTTP.readyState==4) { m=document.getElementById(zz).innerHTML; document.getElementById(zz).innerHTML=m+objXMLHTTP.responseText; document.getElementById(b).src="images/minus_symbol.gif"; } } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.