跨域net::ERR_CONNECTION_REFUSED解决方法
来源:互联网 发布:网络作家排行榜2015 编辑:程序博客网 时间:2024/06/06 17:15
var a=1;
function ping(){
var inp = document.getElementById("ipdz").value;
var url = "http://192.168.0.123/index.php?m=&c=HttpInterface&a=getSksbxx&ip=+"+inp+"";
jQuery.ajax({
type : "GET",
async : false,
url : url,
dataType : "jsonp",
jsonp : "callback",// 传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认为:callback)
jsonpCallback : "flightHandler",// 自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名,也可以写"?",jQuery会自动为你处理数据
success: function(json){
console.log(json);
if(json != null && json != ''){
arr=json.split(',');
if(arr[0]!=-1){
data=xmlToJson(toXmlDom(arr[0]));
document.getElementById('ipdz').value=inp;
var sbbh=data.business.body.sksbbh["#text"];//税控设备编号
document.getElementById('sbbh').value=sbbh;
var jsbh=data.business.body.jsbh["#text"];//机身编号
document.getElementById('jsbh').value=jsbh;
var nsrsbh=data.business.body.nsrsbh["#text"];//纳税人识别号
document.getElementById('nsrsbh').value=nsrsbh;
var nsrmc=data.business.body.nsrmc["#text"];//纳税人名称
document.getElementById('nsrmc').value=nsrmc;
var swjgdm=data.business.body.swjgdm["#text"];//税务机关代码
document.getElementById('swjgdm').value=swjgdm;
var swjgmc=data.business.body.swjgmc["#text"];//税务机关名称
document.getElementById('swjgmc').value=swjgmc;
var fplxdm=data.business.body.fplxdm["#text"];//发票类型代码
document.getElementById('fplxdm').value=fplxdm;
var dqsz=data.business.body.dqsz["#text"];//当前时钟
document.getElementById('dqsz').value=dqsz;
var qysj=data.business.body.qysj["#text"];//启用时间
document.getElementById('qysj').value=qysj;
var bbh=data.business.body.bbh["#text"];//版本号
document.getElementById('bbh').value=bbh;
var kpjh=data.business.body.kpjh["#text"];//开票机号
document.getElementById('kpjh').value=kpjh;
var qylx=data.business.body.qylx["#text"];//企业类型
document.getElementById('qylx').value=qylx;
var blxx=data.business.body.blxx["#text"];//保留信息
document.getElementById('blxx').value=blxx;
var qtkzxx=data.business.body.qtkzxx["#text"];//其它扩展信息
document.getElementById('qtkzxx').value=qtkzxx;
var ipdz=data.business.body.ipdz["#text"];//IP地址
document.getElementById('wlan').value=wlan;
var sn=data.business.body.sn["#text"];
document.getElementById('sn').value=sn;
var sblx=data.business.body.sblx["#text"];
document.getElementById('sblx').value=sblx;
}else{
$.WebUI.toast("设备暂时未被激活/或输入正确的IP", "warning");
}
}else{
$.WebUI.toast("没有此设备", "warning");
}
a=0;
},complete: function(XMLHttpRequest, textStatus) {
$.WebUI.toast(textStatus, "warning");
a=0;
},error: function(json){
$.WebUI.toast(json, "warning");
a=0;
}
});
if(a==1){
$.WebUI.toast("请求别拒绝或网络超时", "warning");
}
}
- 跨域net::ERR_CONNECTION_REFUSED解决方法
- 102 (net::ERR_CONNECTION_REFUSED)
- net::ERR_CONNECTION_REFUSED解决办法
- ajax错误处理 net::ERR_CONNECTION_REFUSED
- 错误102 (net::ERR_CONNECTION_REFUSED): 未知的错误
- JavaScript处理ajax时net::ERR_CONNECTION_REFUSED
- Failed to load resource: net::ERR_CONNECTION_REFUSED
- android webview 此入网页不能载入为:net::ERR_CONNECTION_REFUSED
- WebSocket connection to 'ws://localhost/aa/ws1' net::ERR_CONNECTION_REFUSED
- asp.net报表解决方法
- asp.net报表解决方法
- .net 错误解决方法记录
- java.net.UnknownHostException解决方法
- net::ERR_BLOCKED_BY_RESPONSE 解决方法
- .net中报表的解决方法
- .net 中文乱码解决方法-王道
- asp.net常见问题及解决方法
- 调试ASP.NET出错解决方法
- 字符常量与字符串常量
- php上传图片到服务器&&上传excel到服务器并写入MySQL
- struct和typedef
- oc中类的set get方法
- Java中StringBuffer的用法介绍
- 跨域net::ERR_CONNECTION_REFUSED解决方法
- Java String.split()用法小结
- Android studio
- golden-gate DDL
- MFC 命名规范
- shrink-to-fit和shrink-to-fit=no
- hadoop2.7.3 集群安装
- 康奈尔笔记记录法[转
- 开发中的一些问题