AJAX IE7 Working but Mozilla Problem

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2009
Posts: 1
Reputation: balamad is an unknown quantity at this point 
Solved Threads: 0
balamad balamad is offline Offline
Newbie Poster

AJAX IE7 Working but Mozilla Problem

 
0
  #1
Jul 6th, 2009
this prgram working in ie well but in mozilla mma() ajax function working the second one not working in mozilla..

plz help me

  1. function getHTTPObject()
  2. {
  3. if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
  4.  
  5. else if (window.XMLHttpRequest) return new XMLHttpRequest();
  6. else
  7. {
  8.  
  9. alert("Your browser does not support AJAX.");
  10. return null;
  11. }
  12. }
  13.  
  14.  
  15.  
  16. function hsc(va2)
  17. {
  18.  
  19. var zs,zs1,y1,y2,zz,z1,y3;
  20. zs=va2;
  21.  
  22. y1=document.getElementById(zs).src;
  23. y2=y1.match("minus_symbol.gif");
  24. y3=y1.match("plus_symbol.gif");
  25. zs1= zs.split("img");
  26. zz=zs1[1];
  27. if(y2=="minus_symbol.gif") //second one [COLOR="Red"][/COLOR]
  28. {
  29.  
  30. z1='ct='+zz;
  31. b="img"+zz;
  32. url ="get_catname.php";
  33. objXMLHTTP1 = getHTTPObject();
  34. objXMLHTTP1.open("POST",url,true);
  35.  
  36. objXMLHTTP1.onreadystatechange = stateChanged;
  37.  
  38. objXMLHTTP1.setRequestHeader('content-type','application/x-www-form-urlencoded');
  39. objXMLHTTP1.send(z1);
  40. function stateChanged()
  41. {
  42. if (objXMLHTTP1.readyState==4)
  43. {
  44. document.getElementById(zz).innerHTML="";
  45. document.getElementById(zz).innerHTML=objXMLHTTP1.responseText;
  46. document.getElementById(b).src="images/plus_symbol.gif";
  47.  
  48. }
  49. }
  50. }
  51. if(y3=="plus_symbol.gif")
  52. {
  53.  
  54. [COLOR="Red"] mma(); //first one[/COLOR]
  55. }
  56.  
  57. function mma()
  58. {
  59. b="img"+zz;
  60. z='ct='+zz;
  61. url ="get_subcategname.php";
  62. objXMLHTTP = getHTTPObject();
  63. objXMLHTTP.open("POST",url,true);
  64. objXMLHTTP.onreadystatechange = stateChanged;
  65. objXMLHTTP.setRequestHeader('content-type','application/x-www-form-urlencoded');
  66. objXMLHTTP.send(z);
  67.  
  68. function stateChanged()
  69. {
  70. if (objXMLHTTP.readyState==4)
  71. {
  72. m=document.getElementById(zz).innerHTML;
  73. document.getElementById(zz).innerHTML=m+objXMLHTTP.responseText;
  74. document.getElementById(b).src="images/minus_symbol.gif";
  75. document.getElementById('apDiv10').innerHTML="";
  76.  
  77.  
  78.  
  79. }
  80. }
  81. }
  82. }
Last edited by peter_budo; Jul 6th, 2009 at 10:50 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 313
Reputation: Thirusha is an unknown quantity at this point 
Solved Threads: 50
Thirusha's Avatar
Thirusha Thirusha is offline Offline
Posting Whiz

Re: AJAX IE7 Working but Mozilla Problem

 
0
  #2
Jul 7th, 2009
Why do u have two function stateChanged() and why do u have a function within a function?

I suggest get rid of the second stateChanged() function.

Download firebug for firefox, great tool for debugging.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC