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 ',
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
Looked at the CI page class did not write about Ajax content, but also saw several other great God wrote the page class extension, it is not really necessary.
Making a small change on the existing basis is still achievable.
Let's get down to
Many of the projects recently developed by the company require Cross-domain AJAX requests, such as several sub domainsHttp://a.****.com/index123.aspx,Http://b.****.com/index2.aspx
To request the user JSON information, and then to process the data,
Example:
Rsajax.js:
Copy Code code as follows:
var http_request = false;
function makepostrequest (URL, parameters) {
Http_request = false;
if (window. XMLHttpRequest) {
Http_request = new XMLHttpRequest ();
if
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,
The page to update
Copy Code code as follows:
Phase I Phase II Hello
Action Page
Copy Code code as follows:
protected void Page_Load (object sender, EventArgs e)
{
if (request.params["data").
One, usagejquery's load function is a call that requests another file and loads it into the current DOM, and the full format of the Load method is: Load (URL, [data], [callback]) (note that no parameters are get-mode requests, and parameters are
Load HTML
We typically use HTML-loaded methods to load HTML fragments and insert them in the specified location, assuming the current page is:
load
The contents of the test.html file in the same directory are:
test
We
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
Directly to say the problem, in a page with jquery (1.6) Ajax request, with the post, passing the display of the array has more than 500. PHP can only accept 50 or so. Initially thought is the Web server Setup problem, put, max_upload_size this kind
jquery Ajax asynchronous request receive return JSON data method Setup is simple, one is the server handler is to return the JSON data, the other is the AJAX send settings datatype set to JSONP format data or JSON format can.
The code example is as
Through jquery's built-in AJAX capabilities, direct access to the background to obtain JSON-formatted data, and then through the Jquer data binding to the previously designed HTML template, directly on the page display.Let's look at the HTML
observation function
The Ajaxstart and Ajaxstop functions can be used as observation functions, and we can use the callback function of the observation function to do the corresponding processing.
The Ajaxstart callback function is triggered when
Ajax synchronization and asynchronous differences, first look at 2 pieces of code:
Code One:
Copy Code code as follows:
Synchronize = function (Url,param) {
function Createxhrobject () {
var http;
var ActiveX = [MSXML2. xmlhttp.
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