|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Problem with forefox
hello friends i have a problem with firefox.
i am using AJAX and i want script to wait untill the we get the response from server, but it is not happning in firefox. i am sending a script which i am using from last 6 minths in IE but it is not working in firefox /*Javascript API for Server Call Back Using AJAX*/ var request001; var local; var return_data function Init() { if(window.ActiveXObject) { //alert(); try { request001=new ActiveXObject("Msxml2.XMLHTTP"); // CREATE OBJECT } catch(e) //IF FAILED { try { request001=new ActiveXObject("Microsoft.XMLHTTP");// THEN TRY ANOTHER } catch(oc)// AGAIN FAILED { request001=null;// RETURN NULL } } } else if(window.XMLHttpRequest) { //if(!request001&&typeof XMLHttpRequest!="undefined")// IF OBJECT CREATED //{ request001= new XMLHttpRequest(); //THEN GET THE FUNCTION alert(request001) //request001.overrideMimeType('text/xml'); //} } } function SendRequest(URL)// GET THE REQUEST URL { return_data=null// SET OUTPUT TO BE NULL IN START Init(); // INITIALIZED THE COMPONENT if(request001!=null) { request001.onreadystatechange = Process; // PROCESS THE onreadystatechange request001.open("GET",url+"/" +URL ,false);// SET THE METHOD [GET/POST] AND THE MODE request001.send(""); } return return_data //return return_data+"---wer --"; } function Process() { //onreadystatechange IS A EVENT WHICH ITERATES ITSELF TILL IT NOT GETS THE PERFECT CONDITION. I.E. THE FULL REENDER OF THE PAGE if (request001.readyState == 4)// CHECK FOR THE STAT 4 { alert("-"); if (request001.status == 200)// CHECK FOR THE STATUS 200 { alert(request001.responseText); if(request001.responseText=="") { } else { var result=request001.responseText; alert(result+"---") result=result.substring(0,result.indexOf("@"));// EXTRACT DATA BEFORE @ TO AVOIDE GARBAGE return_data=result; //SET THE OUTPUT TO THE RESULT } } else { } } } |
|
#2
|
||||
|
||||
|
please put your code surronded by [ CODE ] tags, otherwise you lost me from the word go...
colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Problem with forefox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|