I’m trying to make getJSON to use JSONP object, but I can’t figure out how to build the url:
for instance: http://graph.facebook.com/?ids=http://legrandj.eu/article/blouse_ghost_dream
where and how should I add “callback=?” parameter?
thank you
d.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Append
&callback=?to the URL.Given this code, jQuery creates and inserts a
<script src="http://graph.facebook.com/?ids=http://legrandj.eu/article/blouse_ghost_dream&callback=jQuery171022388557461090386_1332329918803&_=133232991983">. Explanation of the URL:&callback=jQuery171022388557461090386_1332329918803jQuery replaces
?incallback=?with an unique temporary identifier.&_=133232991983The FB API returns a response in the following format (JSONP):
Since this is included by the
<script>tag, a functionjQuery171022388557461090386_1332329918803is called, passing the parsed JSON as an argument. The parsed JSON is then passed to the function which you defined injQuery.getJSON.