常用JS方法
2008-05-21 12:24
197 查看
有些js方法,我们经常用,却也经常忘记,所以我就写下来
1,关闭子窗口,给父窗口返回一个值 window.returnValue = "";
2,在子窗口中得到父窗口传过来的参数 var result = window.dialogArguments;
3,弹出一个模态窗口 window.showModalDialog(url,agruments,sFeatures),非模态用showModelessDialog,参数相同。url为要转到的页面,agruments是参数(随便什么都行),sFeatures是窗口大小一类的东西,具体有:
(1)dialogHeight: 对话框高度,不小于100px
(2) dialogWidth: 对话框宽度。
(3) dialogLeft: 离屏幕左的距离。
(4)dialogTop: 离屏幕上的距离。
(5)center: { yes | no | 1 | 0 } : 是否居中,默认yes,但仍可以指定高度和宽度。
(6)help: {yes | no | 1 | 0 }: 是否显示帮助按钮,默认yes。
(7)resizable: {yes | no | 1 | 0 } [IE5+]: 是否可被改变大小。默认no。
(8)status: {yes | no | 1 | 0 } [IE5+]: 是否显示状态栏。默认为yes[ Modeless]或no[Modal]。
(9)scroll: { yes | no | 1 | 0 | on | off }:是否显示滚动条。默认为yes。
4,onload在后台的Page_Load执行后才开始执行
5,str.substring(start,end),截取字符串,如果只有start,则直接截取到结尾。
6,str.indexOf("a"),判断a在字符串中最先出现的位置,如果没有则为-1。这个方法大多被用来判断字符串中是否包含该子串。
7,location.href:js中的转向其它页面的属性。
8,除法取整 var a= 9/2|0;
1,关闭子窗口,给父窗口返回一个值 window.returnValue = "";
2,在子窗口中得到父窗口传过来的参数 var result = window.dialogArguments;
3,弹出一个模态窗口 window.showModalDialog(url,agruments,sFeatures),非模态用showModelessDialog,参数相同。url为要转到的页面,agruments是参数(随便什么都行),sFeatures是窗口大小一类的东西,具体有:
(1)dialogHeight: 对话框高度,不小于100px
(2) dialogWidth: 对话框宽度。
(3) dialogLeft: 离屏幕左的距离。
(4)dialogTop: 离屏幕上的距离。
(5)center: { yes | no | 1 | 0 } : 是否居中,默认yes,但仍可以指定高度和宽度。
(6)help: {yes | no | 1 | 0 }: 是否显示帮助按钮,默认yes。
(7)resizable: {yes | no | 1 | 0 } [IE5+]: 是否可被改变大小。默认no。
(8)status: {yes | no | 1 | 0 } [IE5+]: 是否显示状态栏。默认为yes[ Modeless]或no[Modal]。
(9)scroll: { yes | no | 1 | 0 | on | off }:是否显示滚动条。默认为yes。
4,onload在后台的Page_Load执行后才开始执行
5,str.substring(start,end),截取字符串,如果只有start,则直接截取到结尾。
6,str.indexOf("a"),判断a在字符串中最先出现的位置,如果没有则为-1。这个方法大多被用来判断字符串中是否包含该子串。
7,location.href:js中的转向其它页面的属性。
8,除法取整 var a= 9/2|0;
相关文章推荐
- js常用内置方法和对象
- JS常用方法
- JS中Array方法中常用方法五:Array.prototype.push()
- js常用方法(写给自己)
- JS之常用互动方法
- JS中string方法中常用方法之十:String.prototype.toLocaleLowerCase()
- js(jQuery)获取时间的方法及常用时间类
- JS三大对象中常用方法集锦
- js中常用方法总结
- js中的常用方法
- 2015-03-22——js常用的String方法
- 常用JS方法
- js数组的常用方法,javascript的数组,
- 关于js注册事件的常用方法
- js中Prototype属性解释及常用方法
- JS数组、对象常用方法
- js获取日期、时间、日期常用方法、时间计算并格式化和实现电子表
- js中的正则表达式(含常用方法)《篇1》
- [JS]js常用方法
- js数组去重的三种常用方法总结