Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.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
Jquery facebook图形类计数调用的编码url_Jquery_Facebook - Fatal编程技术网

Jquery facebook图形类计数调用的编码url

Jquery facebook图形类计数调用的编码url,jquery,facebook,Jquery,Facebook,我正在尝试使用fql查询对facebooks graph API进行简单调用 $.ajax({ url: 'https://api.facebook.com/method/fql.query?query=' + encodeURIComponent('select total_count,like_count,comment_count,share_count,click_count from link_stat where url=' + 'http://www.google.se')

我正在尝试使用fql查询对facebooks graph API进行简单调用

$.ajax({
    url: 'https://api.facebook.com/method/fql.query?query=' + encodeURIComponent('select total_count,like_count,comment_count,share_count,click_count from link_stat where url=' + 'http://www.google.se'),
    success: s,
    error: e
});
错误:
Parser错误:位置97处出现意外“:”。


有人能解释一下我应该如何编码URL吗?

在Chrome的web开发者控制台上对我来说很好:

> encodeURIComponent('select total_count,like_count,comment_count,share_count,click_count from link_stat where url=' + 'http://www.google.se')
> "select%20total_count%2Clike_count%2Ccomment_count%2Cshare_count%2Cclick_count%20from%20link_stat%20where%20url%3Dhttp%3A%2F%2Fwww.google.se"

听起来编码失败的可能不是
encodeURIComponent
,而是代码本身的语法分析错误。介意在第97行周围发布代码吗?代码的第97行到底是什么?

注意到我遗漏了应该在调用中包装url的引号。谢谢你!