* Please note: some of these examples will only work on a web server
(they will not run on a desktop or laptop unless you are running them through a web server).
| You can try all code on the book website javascriptbook.com/code | |||
| 1 * | Loading HTML | data-html.html | data-html.js |
| 2 * | Loading XML | data-xml.html | data-xml.js |
| 3 * | Loading JSON | data-json.html | data-json.js |
| 4 | JSONP | data-jsonp.html | data-jsonp.js |
| 5 ** | jQuery .load() | jq-load.html | jq-load.js |
| 6 *** | jQuery $.get() | jq-get.html | jq-get.js |
| 7 *** | jQuery $.post() | jq-post.html | jq-post.js |
| 8 ** | jQuery $.getJSON() | jq-getjson.html | jq-getjson.js |
| 9 ** | jQuery $.ajax() | jq-ajax.html | jq-ajax.js |
| 10 ** | Example | example.html | example.js |
| * | If running locally, comment out checks for the server status | ||
| ** | Needs to be run on a web server | ||
| *** | requires PHP files supplied with download, which require a server | ||
| You can try all code on the book website javascriptbook.com/code | |||