Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/82.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
Javascript Jquery$.getJSON无法检索信息_Javascript_Jquery_Html_Ajax_Json - Fatal编程技术网

Javascript Jquery$.getJSON无法检索信息

Javascript Jquery$.getJSON无法检索信息,javascript,jquery,html,ajax,json,Javascript,Jquery,Html,Ajax,Json,我有一个新闻的JSON url 我正在尝试使用以下内容检索此信息: <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(

我有一个新闻的JSON url

我正在尝试使用以下内容检索此信息:

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $.getJSON("http://www.alcaldiamunicipiosucre.gob.ve/contenido/api/appmob/agenda/?dev=1",function(result){
      $.each(result, function(i, field){
        $("div").append(field + " ");
      });
    });
  });
});
</script>
</head>
<body>

<button>Get JSON data</button>
<div></div>

</body>
</html>

$(文档).ready(函数(){
$(“按钮”)。单击(函数(){
$.getJSON(“http://www.alcaldiamunicipiosucre.gob.ve/contenido/api/appmob/agenda/?dev=1,函数(结果){
$.each(结果、函数(i、字段){
$(“div”).append(字段+”);
});
});
});
});
获取JSON数据
请提供帮助,此示例适用于此页面:

?

告诉我我做错了什么。我无法从json获取信息


非常感谢您。

看起来该域不允许跨域请求。域需要返回

Access-Control-Allow-Origin: *
或同等产品。

看看这个: