jQuery Tutorial
$.getJSON(URL, [data], [callback]);
URL - server side resource communicated via GET method.
data - an object whose properties as name/value pairs to be appended as a query string with the URL.
callback - a function will be invoked and can parses the resulting JSON string as the first parameter and second parameter for status.
<script type="text/javascript" language="javascript"> $(document).ready(function(){ $('#btnResult').click(function(event){ $.getJSON('/result.json', function(student){ $('#result').html('<p>ID:'+student.id+'</p>'); $('#result').append('<p>Name: '+student.name+'</p>'); $('#result').append('<p>Grade: '+student.grade+'</p>'); }); }); }); </script>« Previous Next »
jQuery Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page