Ask a simple question about AJAX voting on a static page

Source: Internet
Author: User




Ask a simple question about AJAX voting on a static page





Let me answer




Website Construction and Solution
I was familiar with AJAX and had a lot of questions.
The page is automatically generated once every 20 minutes. Assume that the number of votes a at the time is 100. After the time is 20 minutes, B has three votes, and the number of votes is changed to 103 when the number of static votes is generated again.
I want to know, suppose m1, m2, m3, three people open the browser and vote accordingly. After m1 opens the static page, the page is displayed as 100, and the result is no less than 101. after m2 opens the browser, will the number of votes displayed on the m2 static page be 100 or 101? In other words, when the server is not static again, the static page displayed by M2 is the number of votes at the time or the number of votes after the m1 vote.
If m2 sees 101 votes, how does it pass the value. Thank you!

Website Construction and Solution
If AJAX is used, you can also vote and return the total number of votes in the database.

Website Construction and Solution
Of course.

Website Construction and Solution
The static variable has been generated. How does the constant number of votes change as a variable?

Website Construction and Solution
Use js to send an asynchronous request to the background script. After processing, it returns relevant data and dynamically updates the div to be displayed in the callback function ~

Website Construction and Solution
With ajax, you can access your dynamic page with only one event and transmit the data. Acceptable data

Website Construction and Solution
I also want to know what I want to know ~~~~

Website Construction and Solution
OK. Thank you!


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.