JS Built-in objects

Source: Internet
Author: User

built-in object definitions : Objects that have ECMAScript implementations that do not depend on the hosting environment, and objects that have been created before ECMAScript run are called built-in objects.

That is, it is not necessary for our developers to instantiate objects to be able to invoke and run objects. Only two built-in object global and math objects are defined in ECM-262

First, global objects

The global (Global) object is a special object in ECMAScript because the object does not exist. Any methods and properties in ECMAScript that are not part of other objects are methods and properties of this object.

1. Encoding/decoding method of global object

Window.onload=function(){          varUrl= "Http://www.baidu.com"; //Code encode          //the method does not encode ASCII letters and numbers, nor does it encode these ASCII punctuation marks:-_.! ~ * ' ().           varEncode=encodeuri (URL);//http://www.baidu.com          //fully encoded, which encodes all non-standard characters found in the URI          varEncodecomponent=encodeuricomponent (URL);//http%3a%2f%2fwww.baidu.com         //decoding        //decodeURI (): Used to decode the URI encoded by the encoding Method encodeURI ()        varDecode=decodeuri (encode);//http://www.baidu.com        //decodeuricomponent (): Used to decode the URI encoded by the encoding Method encodeURIComponent ()        varDecodecomponent=decodeuricomponent (encodecomponent);//http://www.baidu.com      }

Eval () method for 2.Global objects

JS Built-in objects

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.