$.ajax ({
type: "POST",
URL://Your requestor page, whatever.
async:false,//sync: Meaning is when there is a return value will not be followed by the JS program.
The target address of your jump ';
}
}
Ajax only
The $. getjson method of jquery supports cross-origin.
Page request:
$. Getjson (URL + '? Callback =? ', {Operate: 'add'}, function (RES ){}});
It is actually another encapsulation of $. Ajax.
$. Ajax ({type: 'get', URL: URL, data :{},
The main point of Jax is the XMLHTTPRequest object. Different browsers use different methods to create XMLHttpRequest objects. Use the IE browserActivexobjectWhile other browsers useXMLHttpRequestJavascript built-in objects.
The so-called lightbox is, for example, when you look at a photo album and click a photo to highlight the cool effect of the photo,
In fact, prototype, scriptaculous, lightbox. js and other class libraries are used. A small demo
After clicking the submit button, the user submits parameters to the server through Ajax. After the server is added to the database, the user returns the Add result. The page determines based on the results returned by the server. If the ADD is
The helloworld of Ajax will be written, and I will enter the door. Let's take a look. This time I am going to write a tab switch effect. It used to be the first time the page was loaded, so I will read all the frames, then, an event is triggered to
Prototype was used for projects some time ago. JS later found some complicated situations, sometimes with memory overflow, and simply needed it. To ensure program compatibility, it implemented a simple Ajax encapsulation based on the prototype
Create defa9.9.aspx page
Use sriptmanager and updatapanel to put one in updatapanel, implement Timer, and use two viewstates. viewstate ["Index"] stores the content printed by subscript and viewstate ["content ,,,
Code:
Using system;Using system.
Java code
After the previous Ajax operation using jquery, the program request was successful:
1. Status Code 200 is returned, indicating that the server has responded to the client request normally;
2. The httpwatcher of firebug and IE shows
Jquery is an encapsulation of JavaScript, saving programmers from tedious JavaScript code.
Jquery has two common usage methods: Ajax and interface special effects.
In jquery, Ajax communicates with the server through the XMLHTTPRequest object. The
The difference between calling WebService using jquery Ajax and calling WebService using pure JS Ajax is that
The former can run normally on IE, chrome, and Firefox, while the latter can only run normally on IE, and the former has pure cross-origin
Get: multiple requests return the same result. You can use get to obtain data from the server;
Post: the status on the server needs to be changed.
When using post, you need to set the Content-Type header of the XMLHTTPRequest object, as shown
Problem: Use ajax to pass string variables from the front-end page to the server. The content to be transmitted is ABC +, but after receiving the data, use system. Out. println () to output ABC spaces.
Cause: Some Characters in the URL are
Now, more and more Ajax applications are used. The company found some materials on the Internet so that they can be used in the future, however, I have not found any examples in development. Now I have posted a simple example for your reference. I
One of the ways to submit a form using Ajax is to convert the form data into a string of request strings. Below is
Convert form data into a string of request strings
Function formtorequeststring (form_obj){VaR QUERY_STRING = '';VaR and = '';//
Finally, it's a good time.
An example of Ajax partial Refresh:
Front-end page:
Ajax partial refresh
Background page: [getpart. asp]
Dim rs
Dim SQL
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select * From king_test"
// Ajax application
// My God, I cannot understand PHP. Forget it. Find an example of Asp.net.
/*
Use jquery to generate a div container with the ID "rating ".
The Code generates five links and appends them to the "rating" container. When one of
Today I have nothing to worry about. in C #2.0, I used ajax to write an example of refreshing and fast paging. The time is too short. For the shortcomings, please point out that we should first put ajaxpro. DLL file to reference, you can go to http:/
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