ugrás a tartalomhoz

wifi network test

djszapi · 2009. Ápr. 7. (K), 16.16
  1. var xmlhttp;  
  2.   
  3. function ConnectToNet(url)  
  4. {  
  5.     xmlhttp=null;  
  6.     try {  
  7.         netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");  
  8.     } catch (e) {  
  9.   
  10.     //For IE it comes here.  
  11.   
  12.     //alert("Permission UniversalBrowserRead denied.");  
  13.   
  14.    }  
  15.     // code for Mozilla, etc.  
  16.   
  17.     if (window.XMLHttpRequest) {  
  18.         xmlhttp=new XMLHttpRequest()  
  19.     }  
  20.     // code for IE  
  21.   
  22.     else if (window.ActiveXObject) {  
  23.         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")  
  24.     }  
  25.     if (xmlhttp!=null) {  
  26.   
  27.         xmlhttp._timeout=setTimeout(function() {  
  28.             xmlhttp.abort()  
  29.             document.getElementById('connection_check_div').style.display = "block";  
  30. /*            ConnectToNet('setup.cgi');*/  
  31.         },  
  32.          30000  
  33.         ); //end setTimeout  
  34.         xmlhttp.onreadystatechange=state_Change;  
  35.         xmlhttp.open("GET",url,true);  
  36.         xmlhttp.send(null);  
  37.     } else {  
  38.         alert("Your browser does not support XMLHTTP.")  
  39.     }  
  40. }  
  41.   
  42. function state_Change()  
  43. {  
  44.     if (xmlhttp.readyState==4) {  
  45.         try {  
  46.             if (xmlhttp.status==200) {  
  47.                 document.getElementById('connection_check_div').style.display = "none";  
  48.                 setTimeout("ConnectToNet('setup.cgi')", 2000);  
  49.                 return;  
  50.             } else {  
  51.                 document.getElementById('connection_check_div').style.display = "none";  
  52. /*            alert("Problem retrieving XML data");*/  
  53.                 setTimeout("ConnectToNet('setup.cgi')", 2000);  
  54.             }  
  55.         } catch(err) {  
  56.           document.getElementById('connection_check_div').style.display = "block";  
  57. /*          alert('Exception Error! Please Check Your network connection or the state of Wi-Drive');*/  
  58.           setTimeout("ConnectToNet('setup.cgi')", 2000);  
  59.         }  
  60.     } else {  
  61.     }  
  62. }  
  63.   
  64. ConnectToNet('setup.cgi');  
Idaig jutottam, mar csak annyi a gond vele, hogy fel/le/fel kapcsolodas utan elofordul az hogy villog az adott div, nopersze azert mert a kapcsolat valamiert ugy tunik fel, mint ha lenne/nem lenne? Ezt hogy lehetne stabilizalni, hogy ujra rakapcsolodaskor fixnek erezze + IE-ben is mukodjek ? Koszi.
 
1

...

carstepPCE · 2009. Ápr. 7. (K), 18.07
hali,

tarold az aktualis allapotot egy valtozoban, vagy js objektumban es figyeld ha valtozik, akkor valtoztasd meg a divnek a lathatosagat.

-cs-
Sanyi