AJAX "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML) is a technique used to create fast dynamic Web pages.
1.0 Advantages:1.1 improves the user experience through asynchronous mode.1.2 optimizes the transmission between the
Related articles: PHP JSON data creation and resolution program codeJSONP (JSON with Padding) is an unofficial protocol that allows the server-side integration script tags to be returned to the client and Cross-domain access through JavaScript
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
First know to Jquery.post (URL, [data], [callback], [type])
Describe the parameters:
URL: Sends the request address.
Data: Key/value parameter to be sent.
Callback: callback function when sending success.
Type: Returns the content format, XML,
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
This method is more go, common have the following several;The full page Refresh method is described below: sometimes you might useWindow.location.reload () refreshes the current page.Parent.location.reload () Refreshes the Father object (for
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
Ajax in the operation of the DOM depressed for several days, today finally understand, self-study is bitter ah, bitter a runny nose a tear, the lesson to come out, give a wake up, veteran will not look.
The operation of XML in 1.DOM does not mix
Ajax asynchronous data Operation detailed
Ajax is all called "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), a Web development technology that creates interactive Web applications.
Mainly includes the following technologies:
Solution of error in Response.Write output JS script in Ajax
Ajax 3.5 is not altered. Later tried to Scriptmanager.registerstartupscript (UpdatePanel1, typeof (UpdatePanel), "AAA", ", True); The last true in is changed to
Ajax asynchronously invokes a data instance
Through Ajax in the client call back code, through the background code changes, repair, query data, and return the results to the client, in the client to get the data returned by the server to do the
Create an available Xmlhttpreuqest object
XML document Data
A simple ASP output XML example, Later in our Ajax tutorial example, we will use this file for data read operations html css Tutorials dom javascript
Author: driseAsp:Response. ContentType = "text/html"Response. Charset = "GB2312"Php:Header ("Content-type: text/html; charset = gb2312 ");//Other methods are similar.As long as you set the encoding based on your own page, there is generally no
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service