我有一个插件,可以访问length许多元素的属性.但是,javascript控制台指向jquery.min.js的第12行.
如何回溯以查找插件中的违规行?
任何人都可以告诉我为什么这个jQuery函数不起作用.它没有alert.
$.getJSON('http://api.twitter.com/1/statuses/user_timeline.json?',
{
screen_name: 'samajshekhar',
count: '5',
},
function (data) {
alert('hello world from twitter');
});
Run Code Online (Sandbox Code Playgroud)
在fiddler中,我可以看到已经返回了预期的JSON.
但是,当使用jQuery文档中的示例代码调用flicker的api时,它会alert按预期方式提供
$.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?',
{
tags: 'cat',
tagmode: 'any',
format: 'json'
},
function(data) {
alert('hello world from flicker');
});
Run Code Online (Sandbox Code Playgroud)
我甚至试过Facebook的图形API仍然没有 alert
在示例代码中,我尝试使用getJSON调用facebook,twitter,flicker,只提出了闪烁的调用alert.