js弹出窗口的问题
我的超链接是用js写的弹出新窗口,可是现在单击超链接成了打开二级页面。
js对应代码:
function sendcount(id)
{
window.open("dxsendcount.jsp?id="+id,'详细', 'height=250, width=300px, top=200, left=300, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no' );
}
jsp对应代码:
<label style="cursor:hand" onclick="sendcount('{id}')">发送统计</label>
前几天还是弹出小窗口的,突然就成了打开另一个页面了,以为是浏览器的事,可换了一个还是这样
[解决办法]
'详细'
换成
'_blank'
试试看?
[解决办法]
window.showModalDialog 用这个就木问题鸟。
[解决办法]
/** * @see 弹出模式窗体 * @param title 窗体的标题 * @param winWidth 窗体的宽度 * @param winHeight 窗体的高度 * @param url 窗体的链接 */function dialogWin(title, winWidth, winHeight, url) { if (getO("divDialogWin") == null) { var newDiv = document.createElement("div"); newDiv.setAttribute("id", "divDialogWin"); newDiv.style.border = "2px solid #33CCFF"; newDiv.style.position = "absolute"; newDiv.style.zIndex = 10; newDiv.style.backgroundColor = "#FFFFFF"; newDiv.style.fontSize = "12px"; newDiv.style.display = "none"; if (document.form1 != null) { document.form1.appendChild(newDiv); } else if (getO("form1") != null) { getO("form1").appendChild(newDiv); } else { document.body.appendChild(newDiv); } var newDiv1 = document.createElement("div"); newDiv1.style.backgroundColor = "#33CCFF"; newDiv1.style.height = "22px"; newDiv1.innerHTML = '<table cellpadding="0" cellspacing="0" border="0"><tr><td align="left" height="22" style="cursor:move" id="divDialogTitle" onmousedown="mousePlead1(event,\'divDialogWin\')"></td><td align="right" width="20"><a href="javascript:cliseDialog()" id="linkCloseDialog" title="关闭"><img src="' + getV("hdfPath") + '/common_res/images/check/dialogclose.gif" border="0"/></a></td></tr></table>'; newDiv.appendChild(newDiv1); var newDiv2 = document.createElement("div"); newDiv2.setAttribute("align", "center"); newDiv2.style.paddingTop = "0px"; newDiv2.style.paddingLeft = "0px"; newDiv2.innerHTML='<iframe id="frmDialogWin" name="frmDialogWin" frameborder="0" scrolling="auto" align="top" marginheight="0" marginwidth="0"></iframe>'; newDiv.appendChild(newDiv2); } dialogResize(winWidth, winHeight); getO("frmDialogWin").src = url; getO("divDialogTitle").style.width = (winWidth - 20) + "px"; fullDiv("divDialogTitle", " <strong><font color='#FFFFFF'>" + title + "</font></strong>"); setEnvelopDiv(); showSelects("0"); showDiv("divDialogWin", "1");}/** * @see 关闭模式窗体 */function cliseDialog() { if (getO("divEnvelop") != null) { showDiv("divEnvelop", "0"); } showSelects("1"); if (getO("divDialogWin") != null) { showDiv("divDialogWin", "0"); }}/** * @see 给模式窗体重新设置大小 * @param winWidth 窗体的宽度 * @param winHeight 窗体的高度 */function dialogResize(winWidth, winHeight) { if (getO("divDialogWin") != null) { var width = parseInt(getWinSize().split(";")[0]); var height = parseInt(getWinSize().split(";")[1]); getO("divDialogWin").style.left = ((width - winWidth) / 2) + "px"; getO("divDialogWin").style.top = ((height - winHeight - 22) / 2) + "px"; getO("divDialogWin").style.width = (winWidth + 2) + "px"; getO("divDialogWin").style.height = (winHeight + 24) + "px"; getO("frmDialogWin").width = winWidth + "px"; getO("frmDialogWin").height = winHeight + "px"; }}
[解决办法]
不建议用这个啊,兼容性不好,估计你换浏览器了