Home Backend Development PHP Tutorial Ask a very simple static page AJAX voting question_PHP tutorial

Ask a very simple static page AJAX voting question_PHP tutorial

Jul 13, 2016 am 10:52 AM
ajax answer vote of Simple question static page




Ask a very simple static page AJAX voting question





Let me answer




Website ideas and solutions
When I first met AJAX, I had a lot of confusion.
The page automatically generates a static page every 20 minutes. Assume that the number of votes at time a is 100. After 20 minutes, 3 people vote at time b. When the static page is generated again, the number of votes becomes 103.
I want to know, suppose m1, m2, m3, three people open the browser accordingly and vote. After m1 opens the static page, the display is 100. After the vote, it is displayed as 101. After that, m2 opens the browser. At this time, m2 static page Is the number of votes displayed on the page 100 or 101? In other words, when the server is not re-static, the static page seen by M2 is the number of votes at time a or the number of votes after m1 has finished voting.
If m2 sees 101 votes, how is the value passed during that period? Thanks!

Website ideas and solutions
Using AJAX, you can also return the total number of votes in the database when voting

Website ideas and solutions
Of course you can

Website ideas and solutions
Static has been generated, so how does the constant number of votes become a variable and change?

Website ideas and solutions
Use js to send an asynchronous request to the background script, return the relevant data after processing, and dynamically update the div to be displayed in the callback function~

Website ideas and solutions
Using ajax, you can access your dynamic page with just one event and then transfer the data there. Data can also be accepted

Website ideas and solutions
I asked the same poster, I also want to know ~~~~

Website ideas and solutions
OK, got it. Thank you all!


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632509.htmlTechArticleAsk a very simple static page AJAX voting question and I will answer the website design and solution. I am new to AJAX. Lots of confusion. The page is automatically generated statically every 20 minutes, assuming the time is a vote...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The easiest way to query the hard drive serial number The easiest way to query the hard drive serial number Feb 26, 2024 pm 02:24 PM

The hard disk serial number is an important identifier of the hard disk and is usually used to uniquely identify the hard disk and identify the hardware. In some cases, we may need to query the hard drive serial number, such as when installing an operating system, finding the correct device driver, or performing hard drive repairs. This article will introduce some simple methods to help you check the hard drive serial number. Method 1: Use Windows Command Prompt to open the command prompt. In Windows system, press Win+R keys, enter "cmd" and press Enter key to open the command

How to copy a page in Word How to copy a page in Word Feb 20, 2024 am 10:09 AM

Want to copy a page in Microsoft Word and keep the formatting intact? This is a smart idea because duplicating pages in Word can be a useful time-saving technique when you want to create multiple copies of a specific document layout or format. This guide will walk you through the step-by-step process of copying pages in Word, whether you are creating a template or copying a specific page in a document. These simple instructions are designed to help you easily recreate your page without having to start from scratch. Why copy pages in Microsoft Word? There are several reasons why copying pages in Word is very beneficial: When you have a document with a specific layout or format that you want to copy. Unlike recreating the entire page from scratch

How to initiate WeChat voting How to initiate WeChat voting Feb 23, 2024 pm 12:20 PM

How to initiate WeChat voting? You can initiate voting function in WeChat, but most users don’t know how to initiate voting function in WeChat. Next is the graphic tutorial on how to initiate WeChat voting brought by the editor. Interested users please hurry up Come and take a look! WeChat usage tutorial How to initiate WeChat voting 1. First open the WeChat APP, click on the search box at the top of the main page to enter [Voting] and click [Group Voting] as shown below; 2. Then enter the group voting applet page and click [+ Voting] service button; 3. Finally, edit the content on the create group voting page to initiate voting.

How to solve the 403 error encountered by jQuery AJAX request How to solve the 403 error encountered by jQuery AJAX request Feb 20, 2024 am 10:07 AM

Title: Methods and code examples to resolve 403 errors in jQuery AJAX requests. The 403 error refers to a request that the server prohibits access to a resource. This error usually occurs because the request lacks permissions or is rejected by the server. When making jQueryAJAX requests, you sometimes encounter this situation. This article will introduce how to solve this problem and provide code examples. Solution: Check permissions: First ensure that the requested URL address is correct and verify that you have sufficient permissions to access the resource.

How to solve jQuery AJAX request 403 error How to solve jQuery AJAX request 403 error Feb 19, 2024 pm 05:55 PM

jQuery is a popular JavaScript library used to simplify client-side development. AJAX is a technology that sends asynchronous requests and interacts with the server without reloading the entire web page. However, when using jQuery to make AJAX requests, you sometimes encounter 403 errors. 403 errors are usually server-denied access errors, possibly due to security policy or permission issues. In this article, we will discuss how to resolve jQueryAJAX request encountering 403 error

How to deal with the problem that Laravel page cannot display CSS correctly How to deal with the problem that Laravel page cannot display CSS correctly Mar 10, 2024 am 11:33 AM

"Methods to handle Laravel pages that cannot display CSS correctly, need specific code examples" When using the Laravel framework to develop web applications, sometimes you will encounter the problem that the page cannot display CSS styles correctly, which may cause the page to render abnormal styles. Affect user experience. This article will introduce some methods to deal with the failure of Laravel pages to display CSS correctly, and provide specific code examples to help developers solve this common problem. 1. Check the file path. First check the path of the CSS file.

How to implement page jump in 3 seconds: PHP Programming Guide How to implement page jump in 3 seconds: PHP Programming Guide Mar 25, 2024 am 10:42 AM

Title: Implementation method of page jump in 3 seconds: PHP Programming Guide In web development, page jump is a common operation. Generally, we use meta tags in HTML or JavaScript methods to jump to pages. However, in some specific cases, we need to perform page jumps on the server side. This article will introduce how to use PHP programming to implement a function that automatically jumps to a specified page within 3 seconds, and will also give specific code examples. The basic principle of page jump using PHP. PHP is a kind of

How to solve the problem that jQuery cannot obtain the form element value How to solve the problem that jQuery cannot obtain the form element value Feb 19, 2024 pm 02:01 PM

To solve the problem that jQuery.val() cannot be used, specific code examples are required. For front-end developers, using jQuery is one of the common operations. Among them, using the .val() method to get or set the value of a form element is a very common operation. However, in some specific cases, the problem of not being able to use the .val() method may arise. This article will introduce some common situations and solutions, and provide specific code examples. Problem Description When using jQuery to develop front-end pages, sometimes you will encounter

See all articles