Javascript Jquery$.getJSON无法检索信息
我有一个新闻的JSON url 我正在尝试使用以下内容检索此信息: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(
<!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: *
或同等产品。看看这个: