jquery ajax跨域访问的问题
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#btnSubmit").click(function() {
Search();
});
});
function Search() {
$.ajax({
type: "POST",
url: "http://118.122.89.217:8808/ANBOSS/productView.c?do=queryProduct",
data: {barCode: $("#barCode").val()},
dataType: 'jsonp',
jsonp: 'jsoncallback',
timeout: '10000',
beforeSend:function(){
$("#msg").html("正在查询中,请稍候.....");
},
success:function(json){
$("#msg").html('<h3>您好,您查询的产品结果如下:</h3><div class=hot>'+json+'</div><h3>感谢您对爱恋珠宝的支持!</h3>');
},
error:function(){
$("#msg").html("抱歉,您输入的产品条形编码(证书号)有误,请重新核对您的产品编号。");
}
});
}
</script>type:POST
dataType:jsonp
我在网上看到说'jsonp'可以支持跨域访问就修改了成上面这种但是一直执行不了。
可以输入“1”测试!
相关推荐
wcqwcq 2020-06-26
delmarks 2020-06-14
ppsurcao 2020-06-14
tthappyer 2020-06-07
kentrl 2020-11-10
结束数据方法的参数,该如何定义?-- 集合为自定义实体类中的结合属性,有几个实体类,改变下标就行了。<input id="add" type="button" value="新增visitor&quo
ajaxyan 2020-11-09
zndy0 2020-11-03
学留痕 2020-09-20
learningever 2020-09-19
chongxiaocheng 2020-08-16
ajaxhe 2020-08-16
lyqdanang 2020-08-16
curiousL 2020-08-03