Specify the JavaScript function without () nor parameters xhr onreadystatechange = nomFonction; ou bien aussi // Create a request
The core JavaScript object that makes Ajax possible Method Description Make AJAX requests with the stated default way of passing parameters
$("#more_com") click(function(){ $ ajax({ url : 'more_com php' // La ressource ciblée }); }); Le fichier PHP exécuté côté serveur s'appelle more_com php
AJAX uses a programming model with display and events • These events are user actions, they call functions associated with elements of the web page
Toutes les variables en PHP débutent par le symbole $
jQuery AJAX, requests for data PHP file interacts with database, return JSON data JSON data Request o pass that string value (parameter list) to an
AJAX uses a programming model with display and events These events are user actions, they call functions associated with elements of the web page
regular PHP variables have a single scope – the context within the variable but they exist outside the function and keep their values between calls; ex
HTTP requests can be initiated when a script sets the location property of a window object or calls the submit() method of a form object
server side program (written, for example, in PHP) 3) When the response arrives from the This function attempts to get an Ajax request object by trying
function getCustomerInfo() { var phone = document getElementById("phone") value; var url = "/cgi-local/lookupCustomer php?phone=" + escape(phone);
The function requests data from a web server and displays it: AJAX - Create an XMLHttpRequest Object The keystone of AJAX is the XMLHttpRequest object