This article is well written and has benefited greatly from the long connection of web communications, long polling (polling). 1. What is long polling, long connection
In plain words, the client keeps sending requests to the server to get the latest
Scenario: When the user registers, enter the user name in the text input box, and after the user has entered, determine if the user name exists in the database. In this scenario, the server simply returns TRUE or FALSE.
Write in Java action:
* *
The first step: Establish gettime.asp
Second StepEstablish time.asp
Third StepRun gettime.asp, so that you will see a time taken from the server without a refresh to move around and hopefully help beginners
using Ali Fastjson below is Pom.xml
com.alibaba
fastjson
1.2.9
Ajax return String
JS foreground ajax note introduces jquery files such as jquery.min.js function Testajax () {//text value var
saw the cascading menu of the Big Gorge, I also swim a fish, hey, hei, took a little time to get a cascading menu paste up to see. In this case, the member name is automatically displayed as soon as you select the member category name: first
Error Tip:No ' Access-control-allow-origin ' header is present on the requested resource.
cause of the errorJavaScript is in security consideration and is not allowed to be accessed across domains.
Solutions 1. Install pip install
First, the native JS implementation:
var request = new XMLHttpRequest (); Create a XMLHttpRequest () object
Initiates an HTTP request, but does not send the request to the server, and the last parameter defaults to False, which is sent
First you need to understand what the primary object (native object) of the AJAX request is. XMLHttpRequest
Specific reference to the previous incarnation of Ajax(http://blog.csdn.net/j080624/article/details/55101279).
Knowing the object, you can
Uploading files via a traditional form form submission: HTML code test upload files via rest interface Specify filename: uploading file: keyword 1: keyword 2: keyword 3:
Recently in doing a project, because it involves cross-platform, so the use of jquerymobile this framework, in the development process, the first for the purpose of testing, using a Chrome browser to test the run. The following questions are
Please enter http://blog.csdn.net/hzz780/article/details/42124607 using PHP
In other words, last week, the page local JSON data debugging handed to the program, he told me to always return the error, not executed. I went to the interview with my
first the code.
function SubmitData () {
var xhr = createxhr (); Creates a Xhr object.
Xhr.onreadystatechange = function () {
if (xhr.readystate = = 4) {//ensures that all response data has been obtained
if ((Xhr.status >= 200&&xhr.status
alert
In the 1.post method, the data is placed in the Send () method, passed as a parameter
2. Need to set the request header to indicate the encoding method, the type of data sent
3.post mode does not appear in Chinese garbled and browser cache problems
Prerequisites
Before the small compilation of some of the theoretical content of Ajax, in fact, after these theories also do some practical work, unfortunately at that time the small part did not tidy up, with the project ended, until the use of
I am not a professional front-end development siege Lion, so, the level of this article, may be relatively low, some of the ideas inside, may be more ridiculous. If there are omissions or mistakes, I hope you can point them out. If the value of the
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.