Ajax we often use, but the internet found most of the Ajax compatibility is not strong, the following itself to change a good compatibility of very strong Ajax functions, but also described in the following jquery Ajax compatibility is very strong.
Copy Code code as follows:
/**//*
Asynchronous Request Class
Author: I am not intentional
Date Created: 2009.2
--------------------------------------------------------------------------------------------------------------- ----------------
The first is a function that creates Ajax:
Copy Code code as follows:
var http_request=null;
function Create_ajax () {
Http_request = false;
Start initializing the XMLHttpRequest object
if (window. XMLHttpRequest) {//mozilla
This feature has been in the trial for a week, there is no problem, strange that there is a problem today??
Copy Code code as follows:
Ajaxrequestobj.createeqstatusparameter=function () {
if (Eqstatusarray.length Return
}
var
Realize:
With the above two sentences, each named text box will have five more attributes:
1.action must be. Accepts data submitted by Get method and returns a dynamic page of related Javascript arrays.
2.capture if more than one column of results
Copy Code code as follows:
ajax test
Stock code
Stock name
Current price
Today opening
Yesterday closing
Current price difference
Degree
Highest price
Lowest price
Http://www.jb51.net/article/22031.htm
Personally feel not very satisfied, because vb.net in the. NET environment to perform the collection, the resulting network connection and regular matching consumption is too large, and my final application is
Verify from the Username user table in the database my:
Checkusername.html:
Copy Code code as follows:
Untitled Document
Name:
check_it.php:
Copy Code code as follows:
$username
There are three kinds of methods I have used:
1 Add a hidden button to the page, define the event, and then execute the $ ("#隐藏btnID") of JS. Click () to perform the background method
2 Use Ajaxpro to perform
3 using the Ajax URL: page
Using the above method can really achieve Ajax paging effect, but I always feel not concise enough to study the afternoon, finally a little something O_o
first create the foreground page myajaxpager.aspx
Copy Code code as follows:
First, add a ScriptManager control to the page.
Second, the registration namespace:
Type.registerNamespace ("Demo");
Add constructors, properties, methods to the class.
Demo.sample=function () {}
Iv. Registration
Using the jquery framework: Download jquery.js
Create a new Web project Ajax;
Create a new Jslib folder under WebRoot: Specially store JS file;
Create a new html/jsp page under WebRoot:
Login.html
Copy Code code as follows:
This article realizes using jquery Ajax to realize asynchronous access and asynchronous loading, has certain reference value, the interested small partner may refer to.
"Asynchronous Access"
Use an example to illustrate: Click on the button to
Use jquery's Getjson to get data from the background and refresh the interface, using the following methods, no problem under Chrome,firefox, but unable to refresh the data under IE9
$.getjson (webApp + "/getshowdata.do?limit=" + limit,function
Context
Type: Object
This object is used to set the context of Ajax-related callback functions. That is, let this point in the callback function refer to this object (if this argument is not set, this will point to the options argument passed when
1, before the AJAX send the request plus Anyajaxobj.setrequestheader ("if-modified-since", "0").
2, in the AJAX send the request before adding Anyajaxobj.setrequestheader ("Cache-control", "No-cache").
3, after the URL plus a random number: "Fresh=
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