Now that our onreadystatechange property has a proper response-handling function, we can send our request. Sending a request is comprised of two steps:
- Specify the URL of server-side script that will be used in our Ajax application.
- Use the send function to send off the request.
Our simple PHP script, that we have yet to write, will be called "serverTime.php", so we can already do step 1. The URL is set using the open method, which takes three arguments. The second argument is the important one, as it is the URL of our PHP script.
|