网页新窗口打开问题

来源:百度知道 编辑:UC知道 时间:2024/05/10 06:45:14
相关代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>

<SCRIPT language="javascript">
//Dialog
function NewDialog(id,URLString,dialogWidth,dialogHeight) {
if (window.navigator.userAgent.indexOf("MSIE")>=1){
if (id > 0){
return showModelessDialog(URLString, window, "dialogWidth:" + dialogWidth + "px; dialogHeight:" + dialogHeight + "px; help:no; resizable:yes; scroll:yes; status:n

如果用showModelessDialog显示搜索窗口, 只能新开窗口显示结果, 如果要实现你的想法, 用window.open 显示搜索窗口。

<a href="javascript:NewDialog(0,'http://baidu.com',400,600)">改成
<a href="javascript:" onClick="javascript:window.open (0,'http://baidu.com',400,600,'_blank','width=500,height=400,scrollbars=yes,resizable=yes')
看看行不行。没调试