Welcome to the Treehouse Community
Looking to learn something new?
why is the ?jsoncallback=? link is in XML format when you open it?
https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=? like its kinda confusing that we are going to work with js objetcs.. and this link is in XML format. also copied the exact link from the finished project from workspace (untouched). i was thinking i may have made any mistake in the link but it doesn't looks like it. so help me out on this one lol
Dustin Henry7,392 Points
That link wouldn't let you bypass security prootocols in the browser to access the Flickr API. ?jsoncallback=? Is what lets you bypass the same domain restriction browsers have. There's a video in the first stage of the course for more info, but without the query string the AJAX request will fail. Think of the jsoncallback string as the key into the site and format: "json" as what is letting you get the data back in json format. Without jsoncallback you would not be able to bypass the browser security protocol and without specifying the format Flickr is going to send you the data in XML as its default even though you are accessing a json version of the data.