<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>注册</title>     
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type ="text/javascript" src="jquery.js"></script>    
</head>
<body>
<script type="text/javascript" src="http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>   
<div id="content">   
              
          
</div>   
   <script>
$(function(){   
    $.getJSON("http://query.yahooapis.com/v1/public/yql", {   
    q: "select * from json where url='http://m.weather.com.cn/data/101010100.html'",   
    format: "json"   
}, function(data) {   
    var $content = $("#content")   
    if (data.query.results) {  
        var result = JSON.stringify(data.query.results);
        $content.text(result);  
        var obj = eval('('+result+')');
        alert(obj.weatherinfo.city);
    else {   
        $content.text('no such code: ' + code);   
    }   
});   
          
});
</script>
  
</body>
<script>
      
  
  
</script>
</html>
 
 
http://www.webxml.com.cn/WebServices/WeatherWebService.asmx
 

相关文章:

  • 2021-12-05
  • 2022-02-17
  • 2021-12-07
  • 2022-02-25
  • 2021-12-21
  • 2021-07-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-11-16
  • 2021-09-17
  • 2021-11-17
相关资源
相似解决方案