Add a cache switch for $.getscript ()
The code is as follows
Copy Code
Add cache control to Getscript method(function ($) {$.getscript = function (URL, callback, cache) {$.ajax ({type: ' Get ', Url:url,
This articleIntroduce the Get () function first:
Url,[data],[callback],[type]
Parameter description:
URL: The URL address of the page to be loaded
Data: Key/value parameter to be sent.
Callback: callback function when load succeeds.
Type:
URL submission data is actually the get () method in Ajax
$getURL (String): The URL address where the request is sent.Data (MAP): (optional) The information to be sent to the server, expressed as a Key/value key-value pair, is appended to the
can achieve the same effect, this example is relatively simple, for beginners to learn jquery ajax function of a friend still have some help, and more to do their own to try
ajax_load.html I am Liyun, jquery is very useful!
JQuery AJAX,
Now, more and more people are trying to make web development without refreshing based on Ajax, but in the. NET environment, it is not very convenient to apply Ajax.
1, the problem background
Now, more and more people are trying to make web
UpdatePanel
a very important control in Atlas, powerful and easy to use, allows us to add Ajax to an existing ASP.net site with little change. With the advice of dflying, I am also a world of UpdatePanel into Atlas. This article will add UpdatePanel
The most common method is
Method 1: Server-side code joins
The code is as follows
Copy Code
Response.setheader ("Cache-control", "No-cache, must-revalidate");
Method 2: Use JavaScript to add a random number as
: Add a timestamp or random number to the link in the AJAX request
Summary of three methods
The code is as follows
Copy Code
1.xmlhttp.setrequestheader ("Cache-control", "No-cache");2.url + + "&random=" +math.random ();3
Because the XMLHTTP uses the Unicode code uploads the data, but the General page uses is the gb2312, this causes the display page to produce the garbled code. And when the page to get the XMLHTTP return is the UTF-8 encoding, which caused the
Description: This section describes how to quickly convert a common form into an ajax-based submission and display the result in the dialog box.Body:We have a very common form: Title For ease of demonstration, the method uses get and can be changed
The problems analyzed in this article are amazing. It may be unavailable in general projects. Therefore, you must first understand this application scenario. After analysis, I found that jquery's global $. ajax can be used like this!1.
1. What is the Ajax cache principle?After Ajax successfully sends the data, it stores the request URL and returned response results in the cache. When Ajax is called to send the same request, it retrieves data directly from the cache to improve the
Html code The code is as follows:Copy code Customer Information: Name: , Mobile phone: customer name: "/> customer's phone number: "/> customer gender: Female male Unknown enter the broker ID: & Lt; td width = "86%" & gt; "/>
Jquery's tool functions encapsulate the processing methods of commonly used strings, numbers, arrays, and objects. Below are some of the commonly used methods:String operation The code is as follows:Copy code Var str = 'www.111cn.net ';Console.
Click "change" to randomly change the content.Because there are "standard", "image", "video" and other article forms, here we need to randomly obtain an article in the form of images, and take out the pictures, and links, use ajax to replace the
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