@CC

xiaoxiao2021-04-06  300

I saw a JavaScript statement @cc_on that had not seen it, I found it in Baidu, explained as follows:

Use the @cc_on statement, @ IF or @set statement to activate the conditional compilation. Some typical uses of conditional compilation include using new features in JScript, embedding debugging support and tracking code in the script.

Generally, the conditional compile code is placed in a comment, so the host compiled (such as Netscape Navigator) cannot be understood, and the conditional compilation is ignored. Here is an example.

/ * @ cc_on @ * /

/ * @ IF (@_jscript_version> = 4)

Alert (JScript Version 4 or Better);

@ELSE @ * /

"" You NEED A More Recent Script Engine. ");

/ * @ END @ * /

This example uses a special annotation separator that is only used when the @cc_on statement activation condition is compiled. The scripting engine that does not support condition is only available to see information that needs to update the script engine.

With JavaScript so many years, this statement is still the first time.

转载请注明原文地址:https://www.9cbs.com/read-132345.html

New Post(0)