Ajax asynchronous Transmission: IBM Guide-How AJAX is transmitted

Source: Internet
Author: User
Tags json window

IBM has just released a guide to the way Ajax is transmitted, which talks about using three ways to XMLHTTP, script tags, and frames or iframes.
For these three modes, the author most appreciate the script tags, its loading process is this
var urlstoload = [];
function processrequests ()
{
for (Var u in urlstoload)
{
var sobj = document.createelement (' script ');
SOBJ.SRC = urlstoload[U];
Document.body.appendChild (Sobj);
}
}
function Loaddoc (URL)
{
Urlstoload.push (URL);
}
if (Window.addeventlistener)
Window.addeventlistener (' Load ', processrequests, 0);
Else
Window.attachevent (' onload ', processrequests);
var url = window.location.toString ();
url = url.replace (/\/.*?$/, "sources/jsadd.php");
Loaddoc (URL);
The article also mentions the three forms of the Ajax Transfer data text, HTML, XML, JSON
I personally think that for transmission and transmission data form all have their own advantages, only according to the project needs to choose.
For data forms, using HTML, you can take advantage of the template features of the server-side scripting language. Using XML, you can apply to places where you need standard data sharing, such as stock information or weather information. Using JSON, you can use some client controls, such as ListView that require a large amount of data binding. This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20120721/32057.html

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.