当前位置:Gxlcms > JavaScript > 脚本收藏iframe_javascript技巧

脚本收藏iframe_javascript技巧

时间:2021-07-01 10:21:17 帮助过:4人阅读

1、无提示关闭窗口


2、防止被人iframe
if (top.location != self.location)
{
top.location.href="http://www.34do.net";
}

3、判断一个对象存在不存在
document.all("a")==null(不存在)

4、弹出子窗口
window.open ('default.asp', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')

5、打开模态窗口
window.showModalDialog('default.asp',window,'help: No; resizable: No; status: No;scrollbars:No;center: Yes;dialogWidth:width;dialogHeight:height;')

6、弹出的子窗口刷新父窗口
window.parent.location.reload();

7、模态窗口刷新父窗口
window.parent.dialogArguments.document.execCommand('Refresh');

8、一个js文件包含另外一个js文件
document.write('