关闭弹出窗口后不要刷新父页面,怎么弄
我的代码js文件是这样的functionOpenWindow(Url,Width,Height,WindowObj){varReturnStr=showModalDial...
我的代码
js文件是这样的
function OpenWindow(Url,Width,Height,WindowObj)
{
var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:no;');
return ReturnStr;
}
function AuditOneContent(id)
{
OpenWindow('message_show.asp?id='+id,410,410,window);
location.href=location.href;
}
我在父窗口里调用了该js文件
比如父窗口是index.htm
其中调用方法是:
<a onclick=AuditOneContent("120") >如何办理?</a>
子窗口是:message_show.asp
其中显示内容 展开
js文件是这样的
function OpenWindow(Url,Width,Height,WindowObj)
{
var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:no;');
return ReturnStr;
}
function AuditOneContent(id)
{
OpenWindow('message_show.asp?id='+id,410,410,window);
location.href=location.href;
}
我在父窗口里调用了该js文件
比如父窗口是index.htm
其中调用方法是:
<a onclick=AuditOneContent("120") >如何办理?</a>
子窗口是:message_show.asp
其中显示内容 展开
1个回答
展开全部
[code=JScript][/code]
function openWin(url) {
var h = screen.height;
var w = screen.width;
var sh = (h - 300) / 2;
var sw = (w - 400) / 2;
var str = window.showModalDialog(url, '', 'dialogHeight: 230px; dialogWidth:400px; dialogTop: ' + sh + '; dialogLeft: ' + sw + '; center: yes; help: no;scroll=no;');
window.location.href = window.location.href;
}
JScript code <script type="text/javascript">
var popUpWin = 0;
function PopUpWindow(URLStr, left, top, width, height, newWin, scrollbars) {
if (typeof (newWin) == "undefined")
newWin = false;
if (typeof (left) == "undefined")
left = 100;
if (typeof (top) == "undefined")
top = 0;
if (typeof (width) == "undefined")
width = 800;
if (typeof (height) == "undefined")
height = 760;
if (newWin) {
open(URLStr, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
return;
}
if (typeof (scrollbars) == "undefined") {
scrollbars = 0;
}
if (popUpWin) {
if (!popUpWin.closed) popUpWin.close();
}
popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
popUpWin.focus();
}
</script>
C# code<a href="javascript:void(0);" onclick="javascript:PopUpWindow('UpLoadUserPhoto.aspx',100,100,600,450);">
function openWin(url) {
var h = screen.height;
var w = screen.width;
var sh = (h - 300) / 2;
var sw = (w - 400) / 2;
var str = window.showModalDialog(url, '', 'dialogHeight: 230px; dialogWidth:400px; dialogTop: ' + sh + '; dialogLeft: ' + sw + '; center: yes; help: no;scroll=no;');
window.location.href = window.location.href;
}
JScript code <script type="text/javascript">
var popUpWin = 0;
function PopUpWindow(URLStr, left, top, width, height, newWin, scrollbars) {
if (typeof (newWin) == "undefined")
newWin = false;
if (typeof (left) == "undefined")
left = 100;
if (typeof (top) == "undefined")
top = 0;
if (typeof (width) == "undefined")
width = 800;
if (typeof (height) == "undefined")
height = 760;
if (newWin) {
open(URLStr, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
return;
}
if (typeof (scrollbars) == "undefined") {
scrollbars = 0;
}
if (popUpWin) {
if (!popUpWin.closed) popUpWin.close();
}
popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
popUpWin.focus();
}
</script>
C# code<a href="javascript:void(0);" onclick="javascript:PopUpWindow('UpLoadUserPhoto.aspx',100,100,600,450);">
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询