jquery is a good encapsulation of JavaScript, and it is lightweight, it can be referred to as a framework, the following is to compare the JavaScript and jquery implementation of Ajax to highlight the jquery after its encapsulation, easy to achieve
Ajax:
What is Ajax
Ajax, "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), refers to a web development technology that creates interactive Web applications.
AJAX = Asynchronous JavaScript and XML (a subset of standard generic
Performance
If you use Chrome or Firefox and other browsers to visit this blog, github.com, plus.google.com and other sites, careful you will find that the page between the clicks are asynchronous request through Ajax, and the page URL has changed.
This is to reduce the frequent access to the server caused unnecessary burden on it, but also brought some special business logic can not meet the problem.
For example:
You need a select Drop-down list at the front desk as an AJAX trigger entry,
The effect is as follows:
Copy Code code as follows:
ajax Progress bar
ajax Progress Bar example
Launch long-running Process:
Copy Code code as follows:
To the B/s development era, the page front-end layout also the tab page layout form absorbed over. In particular, combined with Ajax technology, you can more fully play the tab page of good performance and data caching advantages, is a good form of
But I really don't know what to do with the title of this article, if you miss it because of this bad topic, it's really a pity.
I have consulted a number of articles before doing this thing:
I used to use the UpdatePanel updateprogress and other controls, and even to the extent of abuse, just blindly pursuit of no refresh, while the loading picture hints, this looks more beautiful, but feel more loss of performance, and sometimes also
Today in the test project found that an action performed 2 times, this operation takes approximately 5 minutes to complete, engineering environment apache2+tomcat6.0.
The online search found several places to set timeouts:
1.ajax syntax to set the
/* The following code clicks a different link on a Web page via Ajax, and then displays the returned results in a pinned Div on the page. */
insert title here no1 | no2 | no3
When the web is displayed, we often encounter paging display, but the online paging method is too much bandwidth, so I thought of using Ajax to paging, using the returned JSON to process the returned data, greatly simplifying the bandwidth pressure.
Ajax and Server (JSON) communication
The word Ajax, which does not represent anything, is simply a term used to address a range of technologies that promote client-server communication. Server communication is the core of Ajax technology, the goal
It is convenient to add a reference DLL file to use. /201101/tools/newtonsoft.json.net20.rar
In the jquery library, Getjson is actually invoked: Query.get (URL, data, callback, "JSON")
Where the parameters are also emitted in k/v format. The request
In jquery to implement the Ajax load method There are many kinds, unlike the previous JS Ajax only one, the following we introduce jquery AJAX implementation of local loading method summary, there is a need to understand friends can refer to.
Cases
$.ajax Shortcut method
$.get (Url,[data],[callback],[type])
$.post (Url,[data],[callback],[type))
The two methods are requested in different ways and in the same way.Parameter: url[request address],data[The requested data content (obj
Prohibit access to a site that is not in the same domain, an example below to access http://www.google.cn,
Save this code to test.html, the local directly with IE open no problem, but the code uploaded to the server, the problem arises--js
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