I am writing a js script, I write like this
xml=new ActiveXObject("Microsoft.XMLHTTP");
xml.open("GET","http://xxx/test.asp ",false);
xml.send();
Why is this sentence skipped directly when debugging with firbug?
firbug? Use xml=new XMLHttpRequest(); under firefox;
if(window.XMLHttpRequest){ xml=new ActiveXObject("Microsoft.XMLHTTP");}else{ xml=new XMLHttpRequest();}xml.open("GET","http://xxx/test.asp",false);xml.send();
firbug ?In firefox, use xml=new XMLHttpRequest();
if(window.XMLHttpRequest){ xml=new ActiveXObject("Microsoft.XMLHTTP");}else{ xml=new XMLHttpRequest();}xml.open("GET","http://xxx/test.asp",false);xml.send();
function GetLocalIPAdress(){ if(window.ActiveXObject) { xml=new ActiveXObject("Microsoft.XMLHTTP"); }else { xml=new XMLHttpRequest(); } xml.open("GET","http://iframe.ip138.com/ic.asp",false); xml.send(null); kk=xml.ResponseText; alert(kk); i=kk.indexOf("["); ie=kk.indexOf("]"); ip=kk.substring(i+1,ie); alert(ip); return ip;}
iframe.ip138.com is not your domain and cannot be cross-domain
iframe.ip138.com is not your domain and cannot be cross-domain
Then How can I request this ip address?
iframe.ip138.com is not your domain and cannot be cross-domain
Then how can I request this IP address?
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js'></script> <script> function getIp(){ $.getScript( 'http://pv.sohu.com/cityjson' ,function(){ alert( returnCitySN.cip +':' + returnCitySN.cname ) } ) } getIp();</script>