1.

What is the purpose of the url json?(a) Belongs to JSON object(b) Reference JSON formatted data(c) Belongs to JSON(d) Compiles json dataThis question was addressed to me during a job interview.The question is from Parsing Values using JavaScript topic in chapter Parsing, Benchmarking and Logging of JavaScript

Answer»

Right choice is (b) Reference JSON formatted data

To elaborate: The URL JSON is ASSUMED to reference a file of JSON-formatted data. The VALUE PASSED to the CALLBACK is the OBJECT obtained by parsing the URL contents with jQuery.parseJSON(). jQuery.getJSON() uses this type. If the type is “json” and the URL or data string contains “=?”, the type is converted to “jsonp”.



Discussion

No Comment Found

Related InterviewSolutions