<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
  • 2021-12-02
  • 2021-12-04
  • 2021-10-06
  • 2021-11-18
  • 2021-11-20
  • 2021-12-05
猜你喜欢
  • 2021-04-10
  • 2021-08-21
  • 2021-09-28
  • 2021-11-18
  • 2021-12-17
  • 2021-11-14
  • 2021-11-18
  • 2021-04-03
相关资源
相似解决方案