1.var s = Number(4); 把Number当作函数来调用的; 全局函数: 1.强制转化: Number String Boolean 2.转化成数字 :parseInt() 3.编码解码: java:URLEncoder.encode() /URLDecoder.decode(); 主要针对中文 js编码解码函数: 3.1 encodeURI()/decodeURI() 可以直接调用,主要针对中文,常用 推荐 3.2 encodeURIComponent()/ decodeURIComponent() 3.3 escape()/unescape() 备注:URI: 统一资源标识符 identifer URL: 统一资源定位符:location
/
*声明一个网络地址
*/
var path=
"http://www.baidu.com/search?key=强大";
/*把编码的结果输出到界面*/
/
*http:
//www.baidu.com/search?key=