Small doubt in the help of Twitch.tv project

Small doubt in the help of Twitch.tv project
0

#1

So I was reading this help link on git provided by FCC for Twitch.tv project. And there they used the following link https://api.twitch.tv/kraken/streams/freecodecamp?callback=? in example for $.getJSON method.
Shouldn’t be there & instead of ? before callback?


#2

From Wikipedia:

The first question mark is used as a separator, and is not part of the query string.

How JSON works (on Wikipedia).


#3

@jenovs But if you try that link with a browser, it gives no response - blank white space. On the other hand use & instead of ? and it gives the response and shows JSON object.


#4

You should get JSON even without ?callback=?, just by typing https://api.twitch.tv/kraken/streams/freecodecamp in your browser.

Read about jQuery .getJSON().

If the URL includes the string “callback=?” (or similar, as defined by the server-side API), the request is treated as JSONP instead.


#5

Hello, I have moved the article to another section as it is not a wiki entry.