Strict Standards: Only variables should be passed by reference in /home/adrane3/public_html/phpjquery/template.php on line 9
jQuery AJAX I, Basic Ajax calls

There are several ways to use AJAX in jQuery. These are some of the simple ones

Other than .load, the AJAX methods all have a followup function that gets called when the response comes from the server. This function gets passed the variable 'data' which is the HTML or JSON (or whatever else) from the server. These functions all call the file /ajax/simple.htm which contains the following HTML:

<h3>This is loaded by AJAX!</h3>

Each of these links will call one of the AJAX method and replace the link with the returned data

.load()
Click here

.load() is simplest, it just gets the data from a specified URL and loads it into the specified element. See http://api.jquery.com/load/

.get()
Click here

.get allows you to make a GET request with (or without) parameters. Like /file.php?id=25&order=asc . See the .post example for how to pass parameters. It works the same way See http://api.jquery.com/jQuery.get/

.post()
Click here

.post allows you to make a POST request with parameters. Like when submitting a form. See http://api.jquery.com/jQuery.post/

By including the HREF of the page in the link, it can sometimes help when javascript is not working. Progressive enhancement What happens if javascript is turned off