search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

1 answers
Q&A 跨域请求报错问题
跨域请求报错问题
大家讲道理 2016-11-08 15:03:20 Views 870

0
var urlgeren = 'http://dr.vipc.cn/api/MyOrderRecommend.action?gameName=ssq&pn=1'$(function(){
$.ajax({
type:'POST',
url : urlgeren,
dataType : 'jsonp',
jsonp:"jsoncallback",
success : function(data) {
console.log(data)
},
});
})

为什么报这个错误 Unexpected token

把地址放到浏览器能拿到数据啊,ajax请求就报错了;


Your Answer
submit

1 answers
0

jsonp跨域是需要后台支持的,返回的数据要包含在传过去的jsonp中,我直接在浏览器看,你的返回数据是没有进行处理的。http://www.cnblogs.com/dojo-l...X4X

2016-11-08 15:03:40

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use