且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jquery AJAX:请求的资源上不存在“Access-Control-Allow-Origin"标头

更新时间:2022-06-25 03:53:50

我已经添加了 dataType: 'jsonp' 并且它有效!

I have added dataType: 'jsonp' and it works!

$.ajax({
   type: 'POST',
   crossDomain: true,
   dataType: 'jsonp',
   url: '',
   success: function(jsondata){

   }
})

JSONP 是一种发送 JSON 数据的方法,无需担心跨域问题.阅读更多

JSONP is a method for sending JSON data without worrying about cross-domain issues. Read More