Html web page to obtain php web page data and other knowledge records, htmlphp

Source: Internet
Author: User

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.

})

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.