Learn Ajax submitted friends, may wish to refer to it, you will understand some of the skills.
because of the problem of the code itself, the cloud habitat community has been revised, welcome to test.
[Ctrl + A All SELECT Note: If
jquery Ajax in the frequent request data, or repeated requests for data, there is a situation, that is not the normal IE browser, IE browser will set the cache, resulting in a second request will not refresh, the system reported 304 not modify,
When we request data with Ajax, we may experience a multiple-click trigger.
(for example, Ajax onreadystatechange events are triggered multiple times; This is because onReadyStateChange is an event handle.)
Its value (state_change) is the name of
1. Background
The invocation of WebService interface in the ASP.net development environment using the Ajax method in jquery
2. Problems that arise
Causal analysis: The effect of the browser's homology policy (that is, JavaScript or cookies can
Users don't like scroll bars, so we made a tab switch, users do not like to refresh the page, so we are going to use Ajax, in the last few years, almost every web developer, have a little bit of Ajax pride, but know that using Ajax is not enough,
In this paper, the method of realizing Ajax by JS is analyzed. Share to everyone for your reference, specific as follows:
One, what is Ajax
Read data or submit data without refreshing
(first appeared Ajax: Google Maps, drag a new view of the show)
Haha, try so much or encodeuricomponent it works.!!!!
Add a protective measure to the position of Chinese characters:encodeuricomponent(ParentID)
function Loadcity (parentid) {
var city = ' ${hotel.city} ';
$.ajax ({
URL:
Add a user, need to determine whether the phone number exists, the first idea is very simple in the TextBox set up a onmouseout event, in IE has a good embodiment, but in Google is not very good
OK, in a different way, when submitting the form to
Introduction of main function flow
Looping through list data
Click on the list data to enter the details page
Click to sign up to participate in pop-up registration success prompt box
Click on the OK button in the prompt box to jump back
This article illustrates the existence of an AJAX sync validation number. Share to everyone for your reference, specific as follows:
method to execute before saving, Ajax synchronization call Background Verify parcel number exists
function
When the AJAX server side responds to data with PrintWriter Out=resp.getwriter (), Out.print (0), Out.print (1) indicate success or failure, Without out.write There is a reason, first look at print and write the similarities and differences between
In the Web site Refresh method, Ajax refresh is a good user experience refreshing way, in combination with SSH and other popular framework! The most common! Here is a demo that uses an Ajax refresh form.
$ (document). Ready (function ()
Needless to say, the key code looks like this:
Jquery.ajax ({
"type": "Post",
"url": "Http://www.baidu.com",
"Success": function (rel) {
if ( rel.issuccess) {
window.open (rel.url, "_blank");
}
this URL request after successful
Use AJAX technology to implement the Click button, the contents of the TXT text through the pop-up box displayed on the page
/* Events are triggered after the page load completes. * *
The above is the use of AJAX implementation through
One, the effect chart:
Second, the realization process:
Ideas:
Third, part of the code: HTML:
Google
CSS code:
* {
padding:0px;
margin:0px;
}
#searchbox {
margin-top:10px;
height:37px;
width:550px;
}
#
In the process of AJAX background data request, we sometimes want users to know that the background is still doing some things, this time we need to give the user a very clear hint, which is what we call the progress bar
Implementation principle:
1. Written in front:
Read Request:
With certain HTML, CSS, JavaScript, JSON basics
2. What is Ajax
Ajax: "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML) refers to a web development technology that creates interactive Web
The previous mention of duplicate submit form issues, processing token password checksum, redirection, there is a frequently used method is the new page processing form submission, close the current page when finished, and refresh the page before
The type of the button on the page is submit:
Ajax requests, in jquery, are:
$ (function () {
$ (' #submit '). Click (function () {
var creategenreform = $ (' #createGenreForm ');
if (Creategenreform.valid ()) {
var obj = {
Name: $ ('
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