JS Reference Data type

Source: Internet
Author: User

<!--global-->
var uri= "http://www.cnblogs.com/jalja/p/4388649.html";
//Coding
var str1= encodeuri (URI);
var str2= encodeuricomponent (URI);//any non-standard text will be encoded
//decoding
var str3= decodeuri (str1);
var str4= decodeuricomponent (STR2);//any non-standard text will be decoded
//transcoding (URI)
var str5= "China";
var str6=escape (STR5);
var str7=unescape (STR6);
<!--eval (String) JavaScript parser--
var ss= "var a=10;var b=20";
eval (ss);
var ss2=a+b;//30
var strobj= "{' name ': ' AA ', ' age ': ' + '}";
var obj=eval (' (' +strobj+ ') ');
Console.info (obj.age);//20
<!--IsNaN if not number return true-->
var n= ' ten ';
var Flag=isnan (n);//false
<!--Date --
var date=new date ();
var year=date.getfullyear ();//year
var month=date.getmonth () +1;
var day=date.getdate ();//day
var hours=date.gethours ();//
var min=date.getminutes ();//min
var sc=date.getseconds ();//sec

JS Reference Data type

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.