The AJAX request for jquery is the default request cache is true, which is turned on, and defaults to False when datatype is script and JSONP. Now I want to read the cache in the browser, because the AJAX request data is very large, request once is
Copy Code code as follows:
$.ajax ({
URL: ' This address should be replaced by your own ',
Data: {S_courseid:courseid, Currtime:new Date (). GetTime ()},//Add a timestamp, otherwise it will not automatically update
DataType: ' JSON ',
The parameter (data) passed by the requested Ajax path is received in the action by a variable of the same name (with the set Get method), and the returned data is an array of jquery objects that are involved in the called action. will be
First look at the HTML interface code:
')" > this one picture link, which means delete. It does not jump to an interface, but instead clicks off the Click event.
The Click event executes the Delete_order () method. This method passes a parameter,
jquery Pass the Chinese parameter garbled, because the default delivery method is not adopted UTF-8, all we can pass the parameters of the parameters of the code, and then operation, code as follows, the red code for the passed parameters, has been
We're using jquery ajax to extract the data from the background after we want to assign it to the global variable, but how can not be assigned, why?
The reason is actually very simple, we use the AJAX is asynchronous operation, that is, in your
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
Let's take a look at an AJAX example
Copy Code code as follows:
Content of test.jsp:
Copy Code code as follows:
Let's look at the Ajax in jquery
1.load ()
The load () method is the
This example summarizes the common ways in which jquery invokes Ajax requests. Share to everyone for your reference. Specifically as follows:
Example code 1
$.ajax ('/route ', {
type: ' Get '
data: {param1: ' Hello ', param2: ' The World '
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 XMLHttpRequest object that it
When you use "get", the page that you crawl finally adds the encoding type
Copy Code code as follows:
Server side: Servletactioncontext.getresponse (). setcharacterencoding ("Utf-8");
Client page Special effects p/jsp.html
Server-side PHP reads MySQL data, converts it to JSON data, passes it to front-end JavaScript, and operates JSON data. This article demonstrates how jquery sends requests via AJAX to the PHP server and returns JSON data.
JSON (JavaScript Object
After a while, the program uses the jquery load method to request, and it's strange why the request cannot be sent for the second time. Baidu A, who knows the load is to use get way to request, so IE browser to
It is cached. Online Search a lot of
If you include a list of Ajax updates in your page, you need to be careful about event handling in the Inactive Update section.
Take the example of a list interface with a common toolbar:
| Menu1 | Menu2
-------------------------------------------
Through the code example analysis to introduce AJAX implementation page local jump and results returned, the specific contents are as follows:
1. Submit process with result return
Here is a submit button to demonstrate that the HTML code is:
The example of this article describes JS based on Msclass and setinterval to achieve AJAX timing acquisition information and scrolling display method. Share to everyone for your reference, specific as follows:
SetTimeout is used for a delay, only
Ajax: A way to request data without refreshing the entire page; The technology core of Ajax is the XMLHttpRequest object; Ajax request Process: Create XMLHttpRequest object, connect server, send request, receive response data;
/** * Get Ajax
AJAX = asynchronous JavaScript and XML.
AJAX is a technique for creating fast Dynamic Web pages.
AJAX allows Web pages to be updated asynchronously by exchanging small amounts of data in the background with the server. This means it is possible to
The beginning of the company, to do the project to be more overwhelmed, now one months later, more and more handy, the following is JSON to the front-end value and front-end Ajax to receive, to write down also share to everyone.
This is two
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.