Heim >Backend-Entwicklung >PHP-Tutorial >求解,getjson函数哪里写错了解决方法
求解,getjson函数哪里写错了
<script><br />$(function(){<br />$.getjson("http://rate.taobao.com/member_rate.htm?content=1&result=0&from=rate&user_id=281461646&identity=1&rater=0&direction=0&timeLine=-7&callback=shop_rate_list", function(json){<br /> alert("JSON Data: " + json);<br />});<br />})<br /><br />弹不出获取的代码,求哪里写错了<br><br /><font color='#e78608'>------解决方案--------------------<br />而且,js中的json只是轻量级的数组,类似:<br /><dl class='code'>JScript code<pre class="brush:php;toolbar:false">var o={"xlid":"cxh","xldigitid":123456,"topscore":2000,"topplaytime":"2009-08-20"};var jsonranklist=[{"xlid":"cxh","xldigitid":123456,"topscore":2000,"topplaytime":"2009-08-20"},{"xlid":"zd","xldigitid":123456,"topscore":1500,"topplaytime":"2009-11-20"}];<br /><font color='#e78608'>------解决方案--------------------<br />参考#2,而且你的json数据还封装在函数shop_rate_list()中,这就搞不懂了。去JavaScript区问问吧<div class="clear"></script>