CPSC415A
Web Programming

Assignment 11

JavaScript Arrays and Objects

Use AJAX to create a web page that displays the current location of the International Space Station, ISS, updated every few seconds. The web site Open Notify has a server from which you can request a JSON file containing the ISS’s current location. However, many browswers prevent cross-domain AJAX. To get around this use the PHP script

<?php
echo file_get_contents("http://api.open-notify.org/iss-now.json");
?>

which will query the Open Notify site and forward the JSON file. To use the PHP script, create a text file with the extension .php, paste the above code into it, save it in the same directory as your .js file, and use the URL for the PHP script in your AJAX HTTP request. Note, because your code is now using a PHP script, which is server side, you will have to load the web from the cs server, not locally.

Submission

Submit your code on the course Inquire site.