关于这个我也有问题:
<script>
function openSelect(){
var a=window.showModalDialog("select.asp","center:yes")
if(a==undefined) a="";
return document.reg.select.value=a;
}
</script>
==========================
上面是我在reg.asp中的一个javascript,打开select.asp并且在select.asp中返回一个变量赋值给reg.asp表单select
现在问题是select.asp涉及到分页问题,在第一页的话没问题,但是如果在select.asp中点下一页的话,是在新窗口中打开下一页。请问这个问题该怎么解决?

解决方案 »

  1.   

    <html>
    <head>
    <META content="text/html; charset=gb2312" http-equiv=Content-Type>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function aa()
    {
    alert(document.aa.aaa.value);
    }
    -->
    </script>
    </head>
    <body leftmargin="0" topmargin="0" onLoad="aa()">
    <form name="aa">
    <input  type=button name=aaa value="fdsfds">
    </form>
    </body>
    </html>
      

  2.   

    有两需要注意的,直接引用表单元素name属性,最好把它放在form里.
    另外,html是边解释边执行.就是说,会先执行alert(document.aa.aaa.value),但这个时候form也没有,button也没有,肯定会出错误,在body里用onload引用是方法之一.
      

  3.   

    function openSelect(){
    var a=window.showModalDialog("select.asp","center:yes")
    try{
        if(a!="undefined")
        ......
        }
    catch(e)
    {
    //这里写出错处理的代码
    }
    }
      

  4.   

    1.<base target="self"> 在当前窗口打开,不会打开新窗口。
    2.top.close 关。
      

  5.   

    window.showModalDialog("select.asp","center:yes")
    select.asp:
    <script>
    function aaa()
    {
    if (window.confirm("退出?")) {
    return true;
    }
    return false;
    }
    </script>
    <BODY onbeforeunload="aaa()"></BODY>
      

  6.   

    我收集的一段代码。出自:hwq26,没有试过。看行不行
    window.showModalDialog("select.asp","center:yes")select.asp:
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    <!--
    function window_onbeforeunload() {
    window.confirm ("close?");
    }
    //-->
    </SCRIPT>
    </HEAD>
    <BODY LANGUAGE=javascript onbeforeunload="return window_onbeforeunload()">
      

  7.   

    有没有测试过啊单写onbeforeunload是不可以的