April 2018
Beginner
226 pages
4h 47m
English
Let's replace the URL property in our earlier script with a newly created script that will fetch the JSON feed. A few properties such as the URL and dataType have been modified and a few new properties such as contentType and jsonpCallback have been added. We have already discussed the change in the URL property, so let us look at the other properties:
<!DOCTYPE html><html><head> <title>Asynchronous Call to Reddit</title> <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script> $(document).ready(() => { $.ajax({ "url": "http://localhost:3300/.jsonp?jsonp=getStudentData", "type": "GET", "data": ...Read now
Unlock full access