js怎么关闭打印弹框

JavaScript014

js怎么关闭打印弹框,第1张

1、单纯的关闭

window.opener.location.reload()//刷新父窗口中的网页

window.close()//关闭当前窗窗口

2、提交后关闭

function save(){

document.getElementById(“pointsform”).submit()

alert(‘保存成功’)

window.opener.document.getElementById(“cmd”).value=”query”

window.opener.document.getElementById(“form的id”).submit()//提交

window.close()//关闭当前窗口

}

1、单纯的关闭

window.opener.location.reload()//刷新父窗口中的网页

window.close()//关闭当前窗窗口

2、提交后关闭

function save(){

document.getElementById("pointsform").submit()

alert('保存成功')

window.opener.document.getElementById("cmd").value="query"

window.opener.document.getElementById("form的id").submit()//提交

window.close()//关闭当前窗口

}

退弹网页JS代码如下:// JavaScript Document<!--var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6"function ext() //在关闭IE窗口的时候弹出{if(window.event.clientY<132 || altKey) iie.launchURL(popURL)}function brs() //插入Object{document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>"eval("window.attachEvent('onunload',ext)")//-->代码结束.代码使用方法:将上述代码复制进txt文档,将后缀名改为.js,上传至网页空间.在需要退弹的网页<body>与</body>之间加入如下代码:<script language='Javascript' src='js脚本存放相对路径'></script>