弹窗写法
1、调试用:alert(1);
2、确定窗口:confirm();
示例:
简易版:<script type="text/javascript">
function show_confirm() {
var r = confirm("是否删除当前信息!");
}
</script>
复杂点的:
3、弹出页面:window.open(pageURL,name,parameters);
示例:
简易版(火狐调试):
window.open ( 'page.html ', 'newwindow ',
'height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no ')
OA系统copy精简版:
function printGuide(contractId) {
var randomValue = Math.random();
var url = "弹出页面.html";
var w = 550;
var h = 350;
// var w = window.screen.width - 50;
// var h = window.screen.height - 100;
var strLocation = 'height=' + h + ', width=' + w + ', top=200, left=220, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no';
window.open(url, '', strLocation);
}
4、onclick="javascript:self.close()" 当前窗口关闭