Html web page to obtain php web page data and other knowledge records, htmlphp
All php-related webpages must be opened on the Apache server. You must configure the file path of confg. ini.
AJAX:
Requests are sent to the server through events, and the server returns the latest data from time to time. This is the AJAX function.
PS: for the first time, ie will send a request to the server to obtain the latest data, and for the second time, it will obtain the cached data by default, resulting in the data being not up-to-date.
Solution: Use a JavaScript random string
AddEvent (document, 'click', function (){
Var xhr = createXHR (); // create an XHR object
// Xhr. open ('get', 'demo. php', false); // send a request in the get method. The url is demo. php.
Xhr. open ('get', 'demo. php? Rand = '+ Marth. random (), false); // applicable to IE
Xhr. send (null); // send the request. Enter null if get does not require data submission.
Alert (xhr. responseText); // print the data sent from the server.
})