function Getxmlhttp (){var http_request; if (window. XMLHttpRequest) {Http_request = new XMLHttpRequest ();if (Http_request.overridemimetype) {Http_request.overridemimetype ("Text/xml");}}else if (window. ActiveXObject) {try {Http_request = new
This is the simplest.
The code is as follows
Copy Code
$.post ("/index.php?action=ajax&rs=twproajax::checkprotermsexisted", $ (this). Serialize (), function (data) {}, ' json ');
Note that serialize is
Ajax Framework/Library comparison and selection: ECHO2, GWT, DOJO, PROTOTYPE, JQUERY read a few English and Chinese AJAX Library/Framework comparison articles, for the convenience of choice, summed up as follows:
First, in two categories, one is the
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
Objective
Believe that every developer should have some understanding, when the user issued an AJAX request, if the long time in the request phase, and did not give users a response, will give users an illusion, resulting in users think our system "
Introduction to Ajax
Ajax is considered an abbreviation for (asynchronous (asynchronous) JavaScript and XML). Now, technology that allows browsers to communicate with the server without refreshing the current page is called Ajax.
Synchronization
Using AJAX, you can get data asynchronously and render the page more efficiently.
But there are also these problems:
Refresh the page, the page will become the initial state
The browser's forward back function is invalid
Crawler crawling on
Internship process needs to use the asynchronous submission function, so try to understand the Ajax, instantly feel the previous study is really bucket ah, indeed, do web application development, if not jquery and Ajax, it is really white learning,
Waterfall flow is currently a more popular site interface layout, uneven layout of multiple columns and to reach the bottom of the automatic loading way, so that the site in the visual and user experience can be greatly improved. The earliest use of
With the increasing use of Ajax, the variety of Ajax Library (Prototype), Ajax Framework (DWR), Ajax Toolkit (Dojo,yui) are increasingly enriched, there is no way to combine these? Like spring, of course, I can't get an IOC micro-core to "glue" all
1. Causes
When you do the front page, you need to call the WEBAPI POST request, send some fields and files (equivalent to sending the form asynchronously via Ajax, get the return result), and then get the return value to determine if it's
Thinking Analysis:
Effect: When the page is loaded, using AJAX asynchronous back to the request data, loading a class of goods, when the choice of a class of goods loaded two-class goods, the choice of two-class goods loaded three-class goods.
AJAX is a technique for exchanging data with the server, and it can be used to update part of the page in the context of the entire page. Next through this article to introduce some common Ajax methods, we need to be able to study together.
1.url:
This paper analyzes the Ajax Return Ajaxreturn () method in thinkphp. Share to everyone for your reference, specific as follows:
The system supports any AJAX class library, and the action class provides a Ajaxreturn method for Ajax calls to return
Introduction to 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
In this blog, I don't know what ajax is like.I. The most primitive way to use ajax Personal analysis: This method is good, simple, and flexible, but it is not good, that is, there are many redundant code, which is not conducive to later maintenance.2
The reason is that there are multiple similar asynchronous request actions on the page. Based on the principle of improving code reusability, I encapsulated a function named getData, which receives different parameters, only obtains data and returns
The code is simple, implemented by jQuery + php.JQuery code: The code is as follows:Copy code JQuery (document). ready (function ($ ){$ (". Zan"). click (function (e ){Var $ I = $ (". zan I "), $ B =$ (" "). text ("+ 1"), n = parseInt ($ I.
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