对未填充的api的jquery json调用

对未填充的api的jquery json调用,jquery,json,Jquery,Json,我试图创建一个非常简单的对openweather网站的json调用,但是当我将url粘贴到浏览器中时,什么也没有返回,因为它返回数据 这是我的密码 $(document).ready(function(){ $("button").click(function(){ $.getJSON('http://api.openweathermap.org/data/2.5/forecast?lat=35&lon=139',function(result){ document.writ

我试图创建一个非常简单的对openweather网站的json调用,但是当我将url粘贴到浏览器中时,什么也没有返回,因为它返回数据

这是我的密码

 $(document).ready(function(){
 $("button").click(function(){
 $.getJSON('http://api.openweathermap.org/data/2.5/forecast?lat=35&lon=139',function(result){
   document.write(feed);
  });
 });
 });
这是一把小提琴


任何帮助我开始的事情都会很好!!谢谢

在同一个域上创建一个PHP文件:

<?php 

$lat = isset($_GET['lat']) ? $_GET['lat'] : '0';
$lon = isset($_GET['lon']) ? $_GET['lon'] : '0';
print file_get_contents("http://api.openweathermap.org/data/2.5/forecast?lat=" . $lat . "&lon=" . $lon);

?>
请看电视。包含jQuery并修复$is not defined错误后,您将看到请求被的.replicate阻止
 $(document).ready(function(){
 $("button").click(function(){
 $.getJSON('http://addressofyourscript.com/?lat=35&lon=139',function(result){
   document.write(result);
  });
 });
 });