December 2013
Intermediate to advanced
384 pages
9h 54m
English
$.get("getJSONData.php", myHandler); function myHandler(data){ var responseValue = data.value; }
Using jQuery to get JSON data from the server is extremely easy. Just call the .get(url, handler(data)) method, pass in the url to the server location, and specify a handler to handle the data. For example:
$.get("getJSONData.php", myHandler);
The JSON data returned by the response will be a JSON object that is passed as the first argument to the handler function. You can access the data using dot syntax; for example:
function myHandler(data){ var responseValue = data.value; }
The best way to ...
Read now
Unlock full access