Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Lab - Ajax


  1. Base it on the demo of JavaScript calling a server-side program in background.
  2. You will get this working on student.computing.dcu.ie
  3. Copy my HTML to a HTML file in your public_html.
  4. Copy my JS to a JS file in your public_html.
  5. The URL of your HTML file will be something like: https://student.computing.dcu.ie/~userid/file.html

  6. Edit a new PHP file in your public_html. This will be the server-side program it calls.
  7. The URL of your PHP program will be something like: https://student.computing.dcu.ie/~userid/prog.php

  8. Change the JS from calling my PHP program on my server to calling your PHP program on student.computing.dcu.ie
    • Note in the JS how you should remove the "http://server" part of the URL. This is Same origin policy. (In fact, depending on browser, leaving "http://server" in may work, but only if same-origin.)

  9. Your PHP program does something with the argument.



ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.