See a problem: Periodically update the state text in a column of the GridView. Now there is a thought: the GridView will eventually generate the table, so we update the columns of the table through Ajax in the page, thus achieving the Ajax update
Definitions and usage
The Ajax () method loads remote data through an HTTP request.
The approach is the jQuery-bottom AJAX implementation. Simple and easy-to-use high-level implementation see $.get, $.post, etc. $.ajax () returns the
Copy Code code as follows:
var parambeanlist = new Array ();
Array.prototype.addparambean=function (parambeanobj) {
var index = This.containparambean (parambeanobj);
if (index!=-1) {
This[index] = parambeanobj;
} else {
This.push
Copy Code code as follows:
Ajax File Downloads
jquery.download = function (URL, data, method) {
Get URL and data
if (URL && data) {
Data is string or Array/object
data = typeof data = = ' String '? Data:jQuery.param (data);
Before using the Artdialog 5.0 version, very admire the author's creativity and professionalism, now the new version of the function toward lightweight JS convenient development, I still prefer artdialog.open before the function of direct
in the Web development process, we often need to input keywords in the foreground page for data search, we usually use the search method is the search results on another page, such a way to build high-performance Web site is not the most appropriate,
First, we need to XHR objects. This is not difficult for us to encapsulate into a function.
var createajax = function () {var xhr = null; try {//ie series Browser xhr = new ActiveXObject ("Microsoft.XMLHTTP");
} catch (E 1) {try {//non ie
Today in the project to do the remote data loading and rendering the page, until the development phase to realize the problem of Ajax Cross-domain request, vaguely remember jquery has mentioned an AJAX Cross-domain request solution, so immediately
Not much to say, directly paste code:
Here is the JS section:
Copy Code code as follows:
var pageSize = "10";//number of rows per page
var currentpage = "1";//Current page
var totalpage = "0";//Total pages
var rowcount = "0";//total
Ajax code Landing is a milestone in the construction of a team framework, which enables the framework to have a version that can be applied for debugging. This is mainly thought of in the AJAX Framework code:
Framework Compatibility
Copy Code code as follows:
datatype
Type: String
The type of data expected to be returned by the server. If not specified, JQuery will automatically intelligently judge against HTTP Packet MIME information, such as XML
MIME types are
1. The order in which multiple Ajax is executed in a function
Because Ajax in jquery is async by default (asynchronous request), if you want to perform another Ajax after an Ajax execution, you need to async=false.
Copy Code code as follows:
jquery, Ajax are a framework for JavaScript, each with its own different functions, if the JavaScript compared to the father, jquery and Ajax is the biological son of JavaScript. The very complex features in JavaScript enable them to realize is
When you use IIS 7.0来 to host your site on a Windows server, you can configure IIS to automatically compress your JavaScript files using the gzip compression algorithm, which provides significant improvements in performance and file download sizes.
JSONP solves the problem of Cross-domain Ajax invocation. Why cross Domain Ajax calls? This can be in an application directly in front of the front-end through JS invoke another application (under different domain name) API.We also use the JSONP in
Let me just briefly talk about the implementation process:
1. Find the link source, I am here is a string of li under the link
2. Processing style
3. When the mouse moves to load the site of the link source to the specified container, and toggle
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.