I’m trying to make a simple call to facebooks graph API using an fql query.
$.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
});
Error: Parser error: unexpected ':' at position 97.
Can someone explain how I should encode the URL?
Works fine for me on Chrome’s web developer console:
Sounds like it might not be
encodeURIComponentthat failed to encode, but rather a syntax parsing error in your code itself. Mind posting the code around line 97 and what exactly is on line 97 of your code?