IBM guide-Ajax Transmission

Source: Internet
Author: User

IBM has just released a guide to Ajax transmission, which describes how to use XMLHTTP, script tags, and frames or iframes.

Original address https://www6.software.ibm.com/developerworks/education/x-ajaxtrans/

You need to register before downloading the PDF file and source code.

For these three modes, the author most appreciates the script tags, and its loading process is like 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 );

This article also mentions three types of Ajax data transmission: Text, HTML, XML, JSON

I personally think that both the transmission mode and the data transmission mode have their own advantages and can only be selected based on project requirements.

For the data format, HTML can be used to make full use of the template function of the server script language. XML can be used in areas that require standard data sharing, such as stock information or weather information. JSON can be used in some client controls, such as the case that listview requires a large amount of data binding.

 

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.