In Ajax, there are two ways to execute the synchronization (async = False) and asynchronous (async = True) according to the value of async, and asynchronous execution is recommended in the tutorials of the consortium;Here's how synchronization
Because of security restrictions (homology policy, where JavaScript or cookies can only access content under the same domain), two scenarios for Ajax Cross-domain requests
Scenario One: Jsonp (JSON with Padding)But one drawback of JSONP is that it
Index.html
The code is as follows
Copy Code
)/ig; var srcre =/ssrc= ([' "]) (. *?) 1/i; var typere =/stype= ([' "]) (. *?) 1/i; Var match; While match = re.exec (html)) { var attrs = match[1]; var srcmatch =
The following code implementation AJAX is submitting effect: Loading ....
Onchange= "Selecte (this.options[this.options.selectedindex].value)" >
Please select
CssRain1
CssRain2
CssRain3
CssRain4
You chose Region 2.
Starbox
With Starbox, you can easily create various types of rating Boxes. The project is based on the Prototype JavaScript Framework, and additional scriptaculous frameworks are needed for some special effects.
Starbox
JQuery Ajax rater
I use the Myeclips Tutorial e tool with the function of import jar, the default this jsonplugin has been imported, so only need to see in MyEclipse, is not already imported this package, if already have, then do not have to import.
Okay,
Gettable.ashx fileHttpcontext.current.response.write (Json.getjsondata (ds, Keyfileds.tostring ()));
Large class of data, on the optimization under look at
Success:function (msg) {
var tbodystr = [];
$.each (msg, function (i) {
Microsoft for security issues, completely put ASP.net ajax cross domain Exchange function to the closed. Cross Domain Ajax does give hackers a chance to attack if they are not very sophisticated and careful. However, cross domain Ajax is a very
IE and opera support for Ajax are good. (Thanks to Prototype.js's encapsulation)
This example uses a file to record the chat record and realize the simple chat room
The actual use needs to pay attention to the processing of large user concurrency,
Ajax Implementation Login Verification
JS files are as follows:
var xmlHttp;
function Img1_onclick () {
Checkisvalid ();
}
function Checkisvalid ()
{
Creatxmlhttprequest ();
var Username=document.getelementbyid ("Admintext");
var
The problems analyzed in this article are amazing. It may be unavailable in general projects. Therefore, you must first understand this application scenario. After analysis, I found that jquery's global $. ajax can be used like this!1.
Load syntax$ (". Selector"). load ("url", function (responseText, statusText, xmlhttprequest ));When loading a page, if an error occurs, the corresponding prompt is displayed based on the status given by statusText, which is very important to the
Code Optimization The code is as follows:Copy code // Force a short-init since we just need core WP, not the entire framework stackDefine ('shortinit', true ); // Build the wp-load.php path from a plugin/theme$ Wp_root_path = dirname (_ FILE __))
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.