问个很简单的静态页面AJAX投票问题
问个很简单的静态页面AJAX投票问题
我来回答
网站建意与解决方法
初识AJAX,有诸多不解。
页面是20分钟自动生成一次静态,假设时间a票数是100,到时间20分钟后时间b有3个人投票,再次生成静态时票数变成103.
我想知道,假设m1,m2,m3,三个人依此打开浏览器经行投票,m1打开静态页面后显示是100,投完后无刷成101.过后m2打开浏览器,此时在m2静态页面中显示的票数是100还是101?换句话说,在服务器没有重新静态时,M2看到的静态页面是a时间的投票数还是m1投完之后的投票数。
假如m2看到的是101票,那期间是怎么传值的。 谢谢!
网站建意与解决方法
用AJAX了 也可以投票的时候同时返回数据库中的总票数吧
网站建意与解决方法
当然可以啊
网站建意与解决方法
已经生成静态了,那票数这个常量是如何成为变量从而变化的呢?
网站建意与解决方法
用js啊,发送异步请求给后台脚本,处理完后返回相关数据,在callback函数里动态更新要显示的div~
网站建意与解决方法
采用ajax 只要一个 事件就可以去访问你的动态页面 然后把数据传输过去。也可以接受数据
网站建意与解决方法
同楼主问,我也很想知道~~~~
网站建意与解决方法
OK,明白了。谢谢大家!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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

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? 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.

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.

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

"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.

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

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
