Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在JSONP中处理twitter fail whale_Twitter_Jsonp - Fatal编程技术网

如何在JSONP中处理twitter fail whale

如何在JSONP中处理twitter fail whale,twitter,jsonp,Twitter,Jsonp,我装载 http://search.twitter.com/search.json?callback=formatTweets&q=somehashTag×tamp=“+新日期().getTime(); 我突然 Error: illegal character Source File: http://search.twitter.com/search.json?callback=formatTweets&q=sunshine&timestamp=130563109759

我装载

http://search.twitter.com/search.json?callback=formatTweets&q=somehashTag×tamp=“+新日期().getTime();

我突然

Error: illegal character
Source File: http://search.twitter.com/search.json?callback=formatTweets&q=sunshine&timestamp=1305631097599
Line: 1, Column: 13
Source Code:
formatTweets(�
因为推特给了我一条失败的鲸鱼

你能想出一种方法来检测和处理这个问题吗

以下是我的祈祷:

function loadTweets() {
  var head = document.getElementsByTagName('head');
  var script = document.createElement('script');
  script.type = "text/javascript";
  script.src = "http://search.twitter.com/search.json?callback=formatTweets&q="+hashTag+"&timestamp="+new Date().getTime();
  head[0].appendChild(script);
}

我发现了一些有趣的答案。总而言之,一种方法是用JSON封装服务器返回的所有错误,另一种方法是重新解释jQuery的JSONP实现。我找不到我的twitter代码,但我认为它可以工作。谢谢