Javascript的使用技巧大全
pe you will stay longer.";}} window.onbeforeunload=verifyClose; 织梦好,好织梦
86.当窗体第一次调用时使用的文件句柄:onload() 本文来自织梦
87.当窗体关闭时调用的文件句柄:onunload() 织梦内容管理系统
88.window.location的属性: protocol(http:),hostname(example.com),port(80),host(e
xample.com:80),pathname("/a/a.html"),hash("#giantGizmo",指跳转到相应的锚记),href(全部的信
织梦内容管理系统
息)
织梦好,好织梦
89.window.location.reload()刷新当前页面. copyright dedecms
90.window.history.back()返回上一页,window.history.forward()返回下一页,window.history.go(返回
第几页,也可以使用访问过的URL)
91.document.write()不换行的输出,document.writeln()换行输出 织梦内容管理系统
92.document.body.noWrap=true;防止链接文字折行.
93.变量名.charAt(第几位),取该变量的第几位的字符. copyright dedecms
94."abc".charCodeAt(第几个),返回第几个字符的ASCii码值. 织梦好,好织梦
95.字符串连接:string.concat(string2),或用 =进行连接
本文来自织梦
96.变量.indexOf("字符",起始位置),返回第一个出现的位置(从0开始计算) 织梦内容管理系统
97.string.lastIndexOf(searchString[,startIndex])最后一次出现的位置.
织梦内容管理系统
98.string.match(regExpression),判定字符是否匹配. 内容来自dedecms
99.string.replace(regExpression,replaceString)替换现有字符串.
100.string.split(分隔符)返回一个数组存储值. dedecms.com
101.string.substr(start[,length])取从第几位到指定长度的字符串. 织梦内容管理系统
102.string.toLowerCase()使字符串全部变为小写. 织梦好,好织梦
103.string.toUpperCase()使全部字符变为大写.
104.parseInt(string[,radix(代表进制)])强制转换成整型. copyright dedecms
105.parseFloat(string[,radix])强制转换成浮点型.
织梦内容管理系统
106.isNaN(变量):测试是否为数值型.
107.定义常量的要害字:const,定义变量的要害字:var 织梦内容管理系统

文章评论
共有位Admini5网友发表了评论 查看完整内容