Conditional compilation commands of IE browser and ajax Implementation of Microsoft

Source: Internet
Author: User
Today in the study of Microsoft testing site http://www.start.com/1, this is an online Rss reading test site, more people are concerned that the entire site is based on the refreshing, its main functions make code even more sweaty, and are all generated by the client JavaScript (app. js), referencing two common js files: msncore. js (core class library implementing ajax) and msncompat. js (it should be an adapter for a non-IE browser), and downloaded its javascript code. I don't know if it is a non-public ajax class library by Microsoft.

Download msncore. js and msncompat. js

In addition, there is a syntax worth noting in its page call.

<! [If! IE]>
<Script src = "MSNCompat. js? V = 0.042005.0 "> // Only required in Firefox </script>
<! [Endif]>
<Script type = "text/javascript" src = "msncore. js? V = 0.042005.1 "> </script>

Obviously, it is a conditional compilation command. If it is not an IE browser, it is first compiled by MSNCompat. js makes some extensions to some browser system classes to be compatible with the calling format of IE. It is more concise than using a lot of if else to judge the browser type and execute different code.

I am going to take a closer look at msncore. js. You may wish to take a closer look at it ~

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.