window.open 的问题 那就是看你的js如何写的,以localhost方式访问和ip方式访问不一样的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接关闭了 ,请确认你的代码中没有诸如 window.close()这样的代码 http://192.168.18.5/login.htm 访问时页面打开后直接关闭了============好像用IP替代localhost要在IIS里面将站点设置虚拟目录才行的即要发布站点,好像是,我也不太确定.楼主可以试下 login.htm 代码:---------------------------------------------------------------<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script type="text/javascript" src="javascript/system.window.js"></script><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>无标题页</title></head><script type="text/javascript">var Window = new Window;function OpenWin(){ Window.Method="open";Window.Href="Default.aspx";Window.Width="1024";Window.Height="768";Window.ScrollBar = "yes";Window.Resize = "yes";//Window.FullScreen="yes";Window.Init();Window.Open();window.opener=null;window.close();}</script><body onload="OpenWin();"></body></html>以下是我在网上下载的一个js文件,用来open出Default.aspx页面-------------------------------------------------------------------------// 把下面的代码保存下来.里面提供了Window.Open所用到的参数// system.window.js// 具体功能看相应的注释/** 调用:Object.Window* 作用:Window 引用类* 参数:* Method 窗口打开方式* Href 窗口地址* Name 窗口标签* ToolBar 显示工具条 yes/no* MenuBar 显示菜单栏 yes/no* ScrollBar 显示滚动条 yes/no* UrlBar 显示地址栏 yes/no* Status 显示状态栏 yes/no* FullScreen 全屏窗口 yes/no* Resize 重设窗口大小 yes/no* Width 窗口宽度 yes/no* Height 窗口高度 yes/no* Place 窗口位置 center/top/openpop* ReturnValue 返回值* TextValue 文本显示* ConfirmTrue 确认返回* ConfirmFalse 取消返回* Params 参数* 返回:*/function Window(){ var Method; var Params; var Splits; var Href; var Name; var ToolBar; var MenuBar; var ScrollBar; var UrlBar; var Status; var FullScreen; var Resize; var Width; var Height; var Place; var Top; var Left; var ReturnValue; var TextValue; var ConfirmTrue; var ConfirmFalse; this.Method = Method; this.Params = Params; this.Splits = Splits; this.Href = Href; this.Name = Name; this.ToolBar = ToolBar; this.MenuBar = MenuBar; this.ScrollBar = ScrollBar; this.UrlBar = UrlBar; this.Status = Status; this.FullScreen = FullScreen; this.Resize = Resize; this.Width = Width; this.Height = Height; this.Place = Place; this.Top = Top; this.left = Left; this.ReturnValue = ReturnValue; this.TextValue = TextValue; this.ConfirmTrue = ConfirmTrue; this.ConfirmFalse = ConfirmFalse;}Window.prototype.Init = function(){ this.Method = this.Method?this.Method:"open"; this.Params = this.Params?this.Params:""; this.Splits = this.Splits?this.Splits:"|"; this.Href = this.Href?this.Href:"about:blank"; this.Name = this.Name?this.Name:Math.round(Math.random() * 100000); this.ToolBar = this.ToolBar?this.ToolBar:"no"; this.MenuBar = this.MenuBar?this.MenuBar:"no"; this.ScrollBar = this.ScrollBar?this.ScrollBar:"no"; this.UrlBar = this.UrlBar?this.UrlBar:"no"; this.Status = this.Status?this.Status:"no"; this.FullScreen = this.FullScreen?this.FullScreen:"no"; this.Resize = this.Resize?this.Resize:"no"; this.Width = this.Width?this.Width:parseInt(screen.width/2); this.Height = this.Height?this.Height:parseInt(screen.height/2); this.Place = this.Place?this.Place:"center"; this.Top = this.Top?this.Top:"30"; this.Left = this.Left?this.Left:"30"; this.ReturnValue = this.ReturnValue?this.ReturnValue:""; this.TextValue = this.TextValue?this.TextValue:""; this.ConfirmTrue = this.ConfirmTrue?this.ConfirmTrue:true; this.ConfirmFalse = this.ConfirmFalse?this.ConfirmFalse:false;}Window.prototype.Open = function(){ // .toLowerCase() switch (this.Method) { /* * 类别:Open * 功能:Window.Open 弹出窗口 中所有功能; */ case "open": if (this.Place == "center") { OpenWinTopXY = "top="+((screen.availHeight-this.Height)/2)+",left="+((screen.availWidth-this.Width)/2); }else if (this.Place == "top"){ OpenWinTopXY = "top=0,left=0"; }else{ OpenWinTopXY = "top="+this.Top+",left="+this.Left+""; } window.open (this.Href,""+this.Name+"","location=no;toolbar="+this.ToolBar+",menubar="+this.MenuBar+",scrollbars="+this.ScrollBar+",resizable="+this.Resize+",directories="+this.UrlBar+",fullscreen="+this.FullScreen+",status="+this.Status+",titlebar=no,width="+this.Width+",height="+this.Height+","+OpenWinTopXY+""); break; /* * 类别:showModlDialog * 功能:对话窗口 */ case "showModalDialog": var DialogObj; DialogObj = window.showModalDialog (this.Href,"","dialogWidth:'"+this.Width+"';dialogHeight:'"+this.Height+"';status:'"+this.Status+"';scroll='"+this.ScrollBar+"';help:no"); return (""+DialogObj+""); break; /* * 类别:showHelp * 功能:HELP帮助 */ case "showHelp": window.showHelp(this.Href); break; /* * 类别:Confirm * 功能:确认对话框 */ case "confirm": var msgbox = window.confirm(this.TextValue); if (msgbox) { eval(this.ConfirmTrue); }else{ eval(this.ConfirmFalse); } break; case "popup": if (this.ie) { this.PopTop=50; this.oPopup = window.createPopup(); var html=this.TextValue; this.oPopup.document.body.innerHTML = html; popshow(); } break; /* * 类别:缺省状态 * 功能:当前页面转发 */ default: top.location=this.Href; break; }} json问题 在线等…… 使用三维控件时滚动条的问题 js能不能显示真正的url地址 问个javascript的简单问题 js对象的问题 单击一个按钮如何用JS实现两个文本框中数字的相加? 含算术表达式的字符串如何转换求出成其中的数值??? 简单问题:请问如何保留两位小数。 html怎样可以执行reg文件? 这行代码是什么意思,在IMG中加事件,如何加? 如何用javascript 在客户端控制上传文件的大小 js设置title属性时如何表示换行符???
============
好像用IP替代localhost要在IIS里面将站点设置虚拟目录才行的即要发布站点,好像是,我也不太确定.楼主可以试下
---------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script type="text/javascript" src="javascript/system.window.js"></script><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
</head><script type="text/javascript">
var Window = new Window;function OpenWin()
{
Window.Method="open";
Window.Href="Default.aspx";
Window.Width="1024";
Window.Height="768";
Window.ScrollBar = "yes";
Window.Resize = "yes";
//Window.FullScreen="yes";
Window.Init();
Window.Open();
window.opener=null;
window.close();
}</script><body onload="OpenWin();">
</body>
</html>
以下是我在网上下载的一个js文件,用来open出Default.aspx页面
-------------------------------------------------------------------------
// 把下面的代码保存下来.里面提供了Window.Open所用到的参数
// system.window.js
// 具体功能看相应的注释/*
* 调用:Object.Window
* 作用:Window 引用类
* 参数:
* Method 窗口打开方式
* Href 窗口地址
* Name 窗口标签
* ToolBar 显示工具条 yes/no
* MenuBar 显示菜单栏 yes/no
* ScrollBar 显示滚动条 yes/no
* UrlBar 显示地址栏 yes/no
* Status 显示状态栏 yes/no
* FullScreen 全屏窗口 yes/no
* Resize 重设窗口大小 yes/no
* Width 窗口宽度 yes/no
* Height 窗口高度 yes/no
* Place 窗口位置 center/top/openpop
* ReturnValue 返回值
* TextValue 文本显示
* ConfirmTrue 确认返回
* ConfirmFalse 取消返回
* Params 参数
* 返回:
*/
function Window()
{
var Method;
var Params;
var Splits;
var Href;
var Name;
var ToolBar;
var MenuBar;
var ScrollBar;
var UrlBar;
var Status;
var FullScreen;
var Resize;
var Width;
var Height;
var Place;
var Top;
var Left;
var ReturnValue;
var TextValue;
var ConfirmTrue;
var ConfirmFalse; this.Method = Method;
this.Params = Params;
this.Splits = Splits;
this.Href = Href;
this.Name = Name;
this.ToolBar = ToolBar;
this.MenuBar = MenuBar;
this.ScrollBar = ScrollBar;
this.UrlBar = UrlBar;
this.Status = Status;
this.FullScreen = FullScreen;
this.Resize = Resize;
this.Width = Width;
this.Height = Height;
this.Place = Place;
this.Top = Top;
this.left = Left;
this.ReturnValue = ReturnValue;
this.TextValue = TextValue;
this.ConfirmTrue = ConfirmTrue;
this.ConfirmFalse = ConfirmFalse;
}Window.prototype.Init = function()
{
this.Method = this.Method?this.Method:"open";
this.Params = this.Params?this.Params:"";
this.Splits = this.Splits?this.Splits:"|";
this.Href = this.Href?this.Href:"about:blank";
this.Name = this.Name?this.Name:Math.round(Math.random() * 100000);
this.ToolBar = this.ToolBar?this.ToolBar:"no";
this.MenuBar = this.MenuBar?this.MenuBar:"no";
this.ScrollBar = this.ScrollBar?this.ScrollBar:"no";
this.UrlBar = this.UrlBar?this.UrlBar:"no";
this.Status = this.Status?this.Status:"no";
this.FullScreen = this.FullScreen?this.FullScreen:"no";
this.Resize = this.Resize?this.Resize:"no";
this.Width = this.Width?this.Width:parseInt(screen.width/2);
this.Height = this.Height?this.Height:parseInt(screen.height/2);
this.Place = this.Place?this.Place:"center";
this.Top = this.Top?this.Top:"30";
this.Left = this.Left?this.Left:"30";
this.ReturnValue = this.ReturnValue?this.ReturnValue:"";
this.TextValue = this.TextValue?this.TextValue:"";
this.ConfirmTrue = this.ConfirmTrue?this.ConfirmTrue:true;
this.ConfirmFalse = this.ConfirmFalse?this.ConfirmFalse:false;
}Window.prototype.Open = function()
{
// .toLowerCase()
switch (this.Method)
{
/*
* 类别:Open
* 功能:Window.Open 弹出窗口 中所有功能;
*/
case "open":
if (this.Place == "center")
{
OpenWinTopXY = "top="+((screen.availHeight-this.Height)/2)+",left="+((screen.availWidth-this.Width)/2);
}else if (this.Place == "top"){
OpenWinTopXY = "top=0,left=0";
}else{
OpenWinTopXY = "top="+this.Top+",left="+this.Left+"";
} window.open (this.Href,""+this.Name+"","location=no;toolbar="+this.ToolBar+",menubar="+this.MenuBar+",scrollbars="+this.ScrollBar+",resizable="+this.Resize+",directories="+this.UrlBar+",fullscreen="+this.FullScreen+",status="+this.Status+",titlebar=no,width="+this.Width+",height="+this.Height+","+OpenWinTopXY+"");
break; /*
* 类别:showModlDialog
* 功能:对话窗口
*/
case "showModalDialog":
var DialogObj;
DialogObj = window.showModalDialog (this.Href,"","dialogWidth:'"+this.Width+"';dialogHeight:'"+this.Height+"';status:'"+this.Status+"';scroll='"+this.ScrollBar+"';help:no");
return (""+DialogObj+"");
break; /*
* 类别:showHelp
* 功能:HELP帮助
*/
case "showHelp":
window.showHelp(this.Href);
break; /*
* 类别:Confirm
* 功能:确认对话框
*/
case "confirm":
var msgbox = window.confirm(this.TextValue);
if (msgbox)
{
eval(this.ConfirmTrue);
}else{
eval(this.ConfirmFalse);
}
break; case "popup":
if (this.ie)
{
this.PopTop=50;
this.oPopup = window.createPopup();
var html=this.TextValue;
this.oPopup.document.body.innerHTML = html;
popshow();
}
break; /*
* 类别:缺省状态
* 功能:当前页面转发
*/
default:
top.location=this.Href;
break;
}
}