JS-Chinese (UNICODE) function and variable name

Source: Internet
Author: User

It was found that for an HTML element, the ID can be Chinese and the Dom can be obtained correctly using the getelementbyid method.

The younger brother was ignorant. Today I know that IE supports JavaScript Chinese programming.


< Input type = Button Value = " Gorush " ID = " Ashun " >

< Script >
Function A Shun: onclick () {alert ( This . Value )} // C ++ Style
Function A Shun: onmouseout (){ This . Style. Background = " Green " }
Function A Shun. onmouseover (){ This . Style. Background = " Red " }

Function Can it be Chinese? (){ // Chinese function name
VaR Sure. = " What can't I do? " // Chinese variable name
Alert (of course );
}

Can it be Chinese? ()

</Script>

Section UNICODE:Function\ U3456 (){
VaR\ U1234="Gorush" 
Alert (\ u1234)
}
\ U3456 ()

AboveCodeRun the test in ie6.0.

Chinese (UNICODE) Functions and variable names are also supported in Firefox., Ie has not been tested in other versions ,.

In fact, this feature has no practical value. You can play it with it...

BTW:
Firefox does not support C ++ function names

function window: onload (){...} // ie support FF does not support
function window. onload (){...} // ie support FF does not support

window. onload = function (){...} // both IE and FF support

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.