Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery ajax的正确方式&x2B;jsonP_Jquery_Ajax_Jsonp - Fatal编程技术网

Jquery ajax的正确方式&x2B;jsonP

Jquery ajax的正确方式&x2B;jsonP,jquery,ajax,jsonp,Jquery,Ajax,Jsonp,我想通过一个JSON存档在线提取一些信息 JSON显示了一本杂志的一些信息(版本)。目前,该杂志共有7种出版物。好的,为此,我需要做一个循环来显示该杂志的所有出版物/版本 我尝试使用AJAX+JSON,但出现了一些问题 $(document).ready(function(){ $.ajax({ type: "get", dataType: "jsonp", url: "http://vectraconstrutora.com.br/li

我想通过一个JSON存档在线提取一些信息

JSON显示了一本杂志的一些信息(版本)。目前,该杂志共有7种出版物。好的,为此,我需要做一个循环来显示该杂志的所有出版物/版本

我尝试使用AJAX+JSON,但出现了一些问题

$(document).ready(function(){
    $.ajax({
        type: "get",
        dataType: "jsonp",
        url: "http://vectraconstrutora.com.br/living/revistas.json",
    }).done(function (data) {
        alert("Done!");
    });
});
警报未显示,因为出现问题:(


我真的需要帮助:“(

除了在
$.ajax()调用中使用
数据类型:“jsonp”
之外,您还需要在服务器端与jsonpweb服务交互,而不是与静态JSON文件交互:如果您想要解决方法,可以使用php获取该url上的内容,然后
ajax()
您的php url。这将消除头痛的问题