JScript Conditional compilation

Source: Internet
Author: User

 

Conditional compilation can use new features of JScript and is compatible with older versions that do not support this feature.

Use the @ cc_on statement, @ if, or @ set statement to activate Conditional compilation. Some typical uses of Conditional compilation include the use of new features in JScript, embedded debugging support in the script, and trackingCode.

Conditional compilation code is usually put in comments, so the host that does not understand Conditional compilation (such as Netscape Navigator) ignores the Conditional compilation. The following is an example.

/* @ Cc_on @*/
/* @ If (@ _ jscript_version> = 4)
Alert ("jscript version 4 or better ");
@ Else @*/
Alert ("You need a more recent script engine .");
/* @ End @*/
This example uses a special annotation separator, which is used only when @ cc_on statements activate Conditional compilation. A script engine that does not support conditional compilation can only view information that requires updating the script engine.

 

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.