A strange problem, in the use of Ajax submitted when the return value assigned to a variable, no matter how to write a value, just start to suspect JS error but IE did not respond, many times clear the cache, the Ministry of Procedures have no
A simple example of Ajax: Selecting a book will get the relevant name in real time via Ajax.
Put 4 HTML files under the same file in your Web site.
Index.html
Copy Code code as follows:
A simple Ajax instance that does not
This example uses jquery.form.js, please go to the demo page to view
CSS Code
Copy Code code as follows:
Xml/html Code
Copy Code code as follows:
0%
JavaScript Code
Now a more popular AJAX-style web page loading, see more in a number of Web sites using AJAX technology, page load will automatically show the message, with load animation effect, the page loaded automatically disappear, is a loading feature of the
Copy Code code as follows:
var xmlhttp = null;
function Myajax () {
1. Create XMLHttpRequest Objects
2, the need for IE and other browsers to create this object different ways to write different code
if (window. XMLHttpRequest) {
For
Copy Code code as follows:
/*
Get and post methods to prevent repeated requests from Ajax
*/
Jquery.extend ({
Getx:function (Url,data,callback,sender) {
var params={url:url,data:null,callback:null,sender:null};
for (Var i=1;iif
Look through the data and get the result: no
But at the same time also found a solution, is to use the way to the IFRAME to submit the form, that is, the implementation of no refresh submission form can upload files!
One, HTML code
Copy Code
I will launch the AJAX original series tutorial in the Web circle, if you don't know what Ajax is, please read: What is AJAX?
Before this we need to do a simple AJAX preparation, but you have to have the basic html,javascript,dom writing ability.
Creates a XMLHttpRequest object.
Copy Code code as follows:
return window. ActiveXObject? New window. ActiveXObject (' Microsoft.XMLHTTP '): New XMLHttpRequest;
A onreadystatechange event for the secondary object. There are two
Request method, divided into get and post:
Get
The most common HTTP request, the normal Internet browsing page is get. The parameter request for Get mode is directly followed by the URL and begins with a question mark. (JS used
That is, in the Trigger Area dropdown box onchange event, the agent's dropdown box options are also corresponding changes, such as the choice of the area of Hunan-〉 Changsha, then the agent dropdown box only shows the agents of Changsha.
Originally
Copy Code code as follows:
-------------------WebService1-----------------------------
To allow the use of ASP.net AJAX to invoke this Web service from a script, uncomment the downlink.
[System.Web.Script.Services.ScriptService]
public
Copy Code code as follows:
-----------------------------htmlpage1.htm---------------------------------
First page Prev next page Last page Id= "Txtpageindex" type= "text"/>Go
-------------------------WebService1---
Scrolling down to the bottom of the page load data is a lot of waterfall streaming site practice, that to see how to achieve with JSONP, side dishes summary record, the master do not spray.
Of course, this example uses the jquery library, the
Before doing project, use a table control, its data is loaded asynchronously, I am in this table binding the data of the function below friends do some business processing, run the page, the browser in my write business processing that place hit the
This article mainly demonstrates the progress bar function of jquery ProgressBar. JS obtains the current progress value in real time through Ajax request to the background. The background stores the progress value in a cookie, and after each request,
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