js实例教程-jquery异步跨域访问实现代码

发布时间:2018-12-03 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了js实例教程-jquery异步跨域访问实现代码脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

代码如下:


/*
$.ajax({
url : url,
tyPE : 'POST',
data : {
CorpID : CorpID,
Pwd : Pwd,
mobile : Mobile,
Content : Content,
Cell : '',
SendTime : ''
},
async : true,//异步
dataType : 'text',//'text','jsonp'
success : function(data, textstatus) {
//alert(data);
if (data == 0) {
alert("短信已发送成功,请注意查收!");
} else if (data == -1) {
alert("账号未注册!");
} else if (data == -2) {
alert("服务端报错信息:其他错误.");
} else if (data == -3) {
alert("帐号或密码错误!");
} else if (data == -4) {
alert("手机号码格式不正确!");
} else if (data == -5) {
alert("余额不足,请先充值!");
} else if (data == -6) {
alert("定时发送时间不是有效的时间格式!");
} else if (data == -7) {
alert("禁止10小时以内向同一手机号发送相同短信!");
} else if (data != null) {
alert("返回代码:" + data);
}
},
error : function(data) {
alert('发送短信: 调用短信接口出错,请及时联系管理员!');
}
});
*/

代码如下:


/*
$.ajax({
url : url,
type : 'POST',
data : {
CorpID : CorpID,
Pwd : Pwd,
Mobile : Mobile,
Content : Content,
Cell : '',
SendTime : ''
},
async : true,//异步
dataType : 'text',//'text','jsonp'
success : function(data, textStatus) {
//alert(data);
if (data == 0) {
alert("短信已发送成功,请注意查收!");
} else if (data == -1) {
alert("账号未注册!");
} else if (data == -2) {
alert("服务端报错信息:其他错误.");
} else if (data == -3) {
alert("帐号或密码错误!");
} else if (data == -4) {
alert("手机号码格式不正确!");
} else if (data == -5) {
alert("余额不足,请先充值!");
} else if (data == -6) {
alert("定时发送时间不是有效的时间格式!");
} else if (data == -7) {
alert("禁止10小时以内向同一手机号发送相同短信!");
} else if (data != null) {
alert("返回代码:" + data);
}
},
error : function(data) {
alert('发送短信: 调用短信接口出错,请及时联系管理员!');
}
});
*/

觉得可用,就经常来吧!Javascript技巧 脚本宝典 欢迎评论哦! js技巧,巧夺天工,精雕玉琢。小宝典献丑了!

脚本宝典总结

以上是脚本宝典为你收集整理的js实例教程-jquery异步跨域访问实现代码全部内容,希望文章能够帮你解决js实例教程-jquery异步跨域访问实现代码所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。