关闭弹出窗口后不要刷新父页面,怎么弄

我的代码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
其中显示内容
展开
 我来答
雷电之剑123_我
2011-02-19 · TA获得超过219个赞
知道答主
回答量:17
采纳率:0%
帮助的人:22.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);">
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式