2020-07-31 jQuery Ajax 实现跨域请求JSONP jQuery Ajax 实现跨域请求JSONP 相信好多朋友在使用jQuery进行Ajax请求接口的时候会出现 No 'Access-Control-Allow-Origin' header is present on the requested resource 然后请求失败,下面我们来简单的解决这个问题。直接上代码<script type="text/javascript" src="/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(function(){ $.ajax( { type:'get', url : 'http://你的域名/test.php', dataType : 'jsonp', //这里是重点,dataType 一定为 'jsonp' jsonp:"jsoncallback",//这里也是重点,jsonp 后面是返... 韩小韩 2020-07-31 闲杂乱码 471 阅读 0 评论 2020年07月31日 471 阅读 0 评论