Problem description: Want to implement click button, appear Blockui layer, and then enter information, click OK, close Blockui, and then invoke Ajax method, but each time to wait until the Ajax execution, the Blockui will be closed, the following
XML file
Myfile.xml
Beijing
Tianjin
Shanghai
Chongqing
*********************************************************
Show Page xml.php
xml Application
Start ajax
Note: Ajaxsend,ajaxstart are global events that can be
The tree menu can be said to be the most widely used application in the project. In the past, regardless of the use of the Microsoft Control tree, or a relatively good Arai type, are all read out the data, and then outline. So if the amount of data
Resolves a JSON object to a string and replaces the corresponding symbol function jsonstringify (obj) {return json.stringify (obj). Replace (/"|{|}
/g, ""). Replace (/:/g, "="). Replace (/,/g, "&");
function Getserverdatauseajax (method, URL,
How to use: Jquery.ajax (Options)
The options have parameters, which appear in the form of Key/value.
In the use of the process, encountered a problem is that the callback method does not execute, and later checked, is the problem of caching.
one, the way to handle cross-domain:
1. Agent
2.XHR2
The XMLHttpRequest Level2 (and XHR2) provided in HTML5 have already implemented cross-domain access. But Ie10 does not support the following
Just fill in the response header on the service
the cache of Ajax blood and tears ~ ~
Scene: Project to IE5 render page, click Export List data (Excel form), click Export Send GET request, background generate Excel file, return file address information
Exception: IE the first return of the
Method OneUse Request.setcharacterencoding ("UTF-8") in the background;Method Two$.ajax ({ Type: ' Post ', ...... ContentType: ' application/x-www-form-urlencoded; Charset=utf-8 'Method Three (This method is absolutely possible)Foreground
Then the last advanced query. The fields in the drop-down boxes are all written in the foreground. This is a big drawback for the flexibility of the system.
Solution Ideas:
Create a Type dictionary table in the database. The drop-down box needs
Do a file upload module, because the traditional form submission will have a page refresh, does not conform to my use requirements, so I use the Ajax submission method, here is explained, my application front end for Ajax submission, backend
1. Setting Up Xmlhttprequest/msxml2.xmlhttp objects
This should be the most common way, very easy to use, can really connect XML objects,
Can be submitted by "POST" "GET",
However, cross-domain is not supported in Firefox
2. Use DOMDocument object,
1 The Done method in Ajax can be used after version 1.5 of jquery. This method has a similar effect as success in Ajax. It must first be after the 1.5 version in jquery.
such as:
2 Ajax's done. Parameters can be written as a method. is a
$.ajax of jquery (Url,[settings])1. The default contenttype value is: application/x-www-form-urlencoded; Charset=utf-8This format is the form submission format, the data is key1=value1&key2=value2 format2. Although the Data property value of Ajax is
From the above, the page jump is obviously not suitable for static and dynamic separation of Ajax interaction architecture mode, so the framework needs to be modified to optimize, allowing the background to return JSON data to the front-end request.
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