首先祝大家中秋快乐,其次问个问题,100分赠送。。。
<script type="text/javascript">
var p2cpdlg = new p2cp_dialog();
function p2cp_dialog()
{
this.params_up = new Array();
this.params_down = new Array();
this.callback = "";
this.win = null;
this.backid = "p2cp_dialog_backid";
//
this.dialogInit = function()
{
var back = document.getElementById(this.backid);
if(back == null)
{
var div = document.createElement("div");
div.innerHTML = "<div id='"+this.backid+"' onmouseup='p2cpdlg.dialogMouseUp();return false;' style='position:absolute;z-index:10000;top:0;left:0;width:1px;height:1px;background-color:#666666;-moz-opacity:0.7;filter:alpha(opacity=70);'></div>";
document.body.appendChild(div.firstChild);
}
};
this.dialogMouseUp = function()
{
if(this.win != null)
{
if(this.win.closed == false)
{
if (navigator.appName == "Microsoft Internet Explorer")
{
this.win.focus();
}
else
{
this.win.open().close();
this.win.focus();
}
}
else
{
this.dialogMin();
}
}
else
{
this.dialogMin();
}
};
this.dialogMin = function()
{
var back = document.getElementById(this.backid);
if(back != null)
{
back.style.width = "1px";
back.style.height = "1px";
}
};
this.dialogMax = function()
{
var back = document.getElementById(this.backid);
if(back != null)
{
var iWidth = document.body.scrollWidth;
if(iWidth < 1000)
{
iWidth = 1000;
}
var iHeight = document.body.scrollHeight;
if(iHeight < 1000)
{
iHeight = 1000;
}
back.style.width = iWidth + "px";
back.style.height = iHeight + "px";
}
};
this.dialogOpen = function(sUrl,iWidth,iHeight,arrUpParams,sCallBack,sWindowName)
{
this.params_up = arrUpParams;
this.params_down = null;
this.callback = sCallBack;
this.dialogInit();
this.dialogMax();
var left = (screen.availWidth-iWidth)/2;
var top = (screen.availHeight-iHeight)/2;
var sProps = 'toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no,width='+iWidth+',height='+iHeight+',left='+left+',top='+top;
if(this.win != null)
{
this.win.close();
this.win=null;
}
this.win = window.open(sUrl,sWindowName,sProps);
this.win.focus();
};
this.dialogClose = function(arrDownParams,bOk)
{
this.dialogMin();
if(this.win != null)
{
this.win.close();
this.win = null;
}
if(bOk)
{
this.params_down = arrDownParams;
eval(this.callback);
}
};
}
function dlg_open(num)
{
p2cpdlg.dialogOpen('Test.aspx',660,440,null,"","test");
}
</script>
上面是网上找的一段打开非模态窗体的js.在本机访问没有任何问题,然后其他局域网机器访问,有些出现“this.win为null或不是对象”的错误,但有些又可以正常操作,我换了台机器做服务器后,服务器本机访问出现“没有注册类别的错误”。其他机器访问又是有些电脑出现上面的第一个错误,有些又没有,甚至还有的打开的窗体跳转到了登陆界面,事实我并没配置出错页面,
环境:VS2005,Windows 2003 SP2........
郁闷了我2天了,有台电脑昨天访问出现this.win为null或不是对象的错误,今天访问又没有了,我本机调式都没问题,,,叫我怎么改啊。。。
麻烦大家帮忙看下问题。。谢谢。。。再次祝大家节日快乐。。。