Instance:
1. Request Ajax. aspx
Html
Code
Copy code The Code is as follows:
div>
Div>
JS Code copy Code the code is as follows:
2. Page ajaxuserinfomodify. aspxBackground codeCopy codeThe Code is as follows: protected void page_load (
CopyCode The Code is as follows:
Finkyui is a very useful jquery plug-in.The guy who wrote this stuff is very strong.Thank you. Otherwise, I don't know when to do this ......---------------------------- Function ---------------------------
I am very happy to have you read the examples of Ajax that I have written. Whether you are your first friend or an old friend, I will show you what I have learned so far,
What Is Ajax?
Important: Ajax is not a language, but a combination of
1. [Use IFRAME]
Add an IFRAME to the page to be loaded, as shown below:
CopyCode The Code is as follows:
Add the function you want to call in onload. If the loaded page is in the pop-up layer, this function should be placed on the parent
After the ASP. net mvc framework is generated, the jquery script is included. For environment settings, see my other article.
Article : ASP. net mvc instance. Here, we still use the environment in the instance. You can see the jquery script in the
Tip: We should always pay attention to browser cache. When using the GET method, we should add the timestamp parameter (net Date ()). getTime () to ensure that the URLs sent each time are different, so that browser cache is avoided.
Tip: when a
For example:
Copy codeThe Code is as follows: function xmlHttpR (){
Var xmlhttp;
If (window. XMLHttpRequest ){
Xmlhttp = new XMLHttpRequest ();
}
Else {
Try {xmlhttp = new ActiveXObject ("Msxml2.XMLHTTP ")}
Catch (e ){
Try {xmlhttp = new
I recently encountered the problem of passing Chinese parameters. Search online, copy, paste, and publish the "ultimate" solution "is nothing more than escape (str) for transcoding, and then write a method on the server to edit it again, or use
Smart. asp
Copy codeThe Code is as follows:
Code:Copy codeThe Code is as follows: Response. charset = "UTF-8"Dim url, method, data, charsetUrl = Request. Form ("targeturl ")Method = Request. Form ("method ")Data = Request. Form ("data ")Charset =
Bind a click event to the element, but one problem is that the click event becomes invalid when I execute some ajax requests.
For example, my page is an ajax request, but when I click the next page, the generated Element a has no click event.
Some pages that are frequently used by AJAX are sometimes not dare to be refreshed, because after refreshing, you may see a very different page from the original one. I will not discuss whether to use AJAX in the case of a large number of page
Search the data to get the result: No
However, we also found a solution, that is, using iframe to submit the form, that is, you can upload files without refreshing the new form!
I. HTML code
Copy codeThe Code is as follows:
no need to submit a
For more information about Ajax submission, see here.
Because of code problems, the script house has been corrected. You are welcome to test it.
Xmlns = "http://www.w3.org/1999/xhtml">
Try to submit a few more messages ......
Show message
Because jquery is used, the. abort () method is not found in the manual. I searched the internet and found it at http://ooxx.me/jquery-ajax-abort.orz. the usage of. abort () in jquery is directly used as an example:
Copy codeThe Code is as follows:
Especially after the popularity of Jquery, porotype, Ext and other frameworks, a large amount of simplified code can be said to bring the gospel to programmers,
Free from the heavy work of code, you can easily implement the complex functions of
Yes, what we want to achieve today is to read and Display Server data without refreshing the webpage.
Take out what we prepared last time.
1: function of the XMLHTTPRequest object.
2: Asp outputs an xml file. You can click to view the File
I will introduce the original ajax series tutorials in the Web circle. If you do not know what ajax is, please read: What Is ajax?
Before that, we need to make some simple ajax preparations, but you must have basic html, javascript, and dom
Take out what we prepared last time. 1: XMLHTTPRequest object function. 2: Asp outputs an xml file. You can click to view the file content: Asp outputs xml format data
After opening it, you will find that we use Asp technology to dynamically output
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