在解决跨域的时候,我通常会用豆瓣api作为尝试。

下面是本地跨域请求豆瓣API:亲测有效:

<script type="text/javascript">
var url = "http://api.douban.com/v2/movie/in_theaters";
$.ajax({
    type:'get',
    url:url,
    dataType:"jsonp",
    jsonpCallback:"cb",
    success:function(res){
        console.log(res);
    }
});
</script>

 

相关文章:

  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-07-16
猜你喜欢
  • 2021-11-26
  • 2022-12-23
  • 2022-01-11
  • 2021-08-12
  • 2022-12-23
相关资源
相似解决方案