//简单弹窗类
function openChildFrame(strUrl, strTitle, strWidth, strHeight, isScrollbar) {
var iheight = strHeight;
var iwidth = strWidth;
var ileft = (screen.width - iwidth) / 2;
var itop = (screen.height - iheight) / 2;
var iscrollbar = isScrollbar;
if (iscrollbar == null || iscrollbar == "") iscrollbar = "no";
var feature = "left=" + ileft + ",top=" + itop + ",fullscreen=0,width=" + iwidth + ",height=" + iheight + ",toolbar=no,menubar=no,scrollbars=" + iscrollbar;
feature += ",resizable=no,location=no,status=yes,dialog=yes";
var strWindow = window.open(strUrl, strTitle, feature);
return strWindow;
}
function openChildFrame(strUrl, strTitle, strWidth, strHeight, isScrollbar) {
var iheight = strHeight;
var iwidth = strWidth;
var ileft = (screen.width - iwidth) / 2;
var itop = (screen.height - iheight) / 2;
var iscrollbar = isScrollbar;
if (iscrollbar == null || iscrollbar == "") iscrollbar = "no";
var feature = "left=" + ileft + ",top=" + itop + ",fullscreen=0,width=" + iwidth + ",height=" + iheight + ",toolbar=no,menubar=no,scrollbars=" + iscrollbar;
feature += ",resizable=no,location=no,status=yes,dialog=yes";
var strWindow = window.open(strUrl, strTitle, feature);
return strWindow;
}
试试这个:<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.js"></script>
</head>
<body>
<script type="text/javascript">
$(function(){
window.showModalDialog('http://www.baidu.com')
});
</script>
</body>
</html>
2、window.open("http://www.baidu.com");
3、检查你的浏览器是否设置了拦截弹出式窗口