用iframe 弄一个1*1的框架, 选择下拉列表 的onchange事件, 连动到iframe就可以了.

解决方案 »

  1.   

    以下三个文件,存在同一个目录下,打开第三个文件,可以看到相关的效果:
    ---------getDataFromServerDialog.htm-----------------
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>JK:支持民族工业,尽量少买X货</title>
    </head><body >
    <h5 align=center valign=middle >正在查找资料</h5>
    </body></html><script>
    windowArguments=window.dialogArguments;function returnFun()
    {
    windowArguments.value="dataFromServer";
    window.close();
    }setTimeout("returnFun()",100);
    </script>
    ---------getDataFromServerDownload.htm-----------------
    dataFromServer
    ---------getDataFromServer.htm-----------------
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>JK:支持民族工业,尽量少买X货</title></head><body>
    Code<input name=a0 onchange="getDataFromServer0()" ><input type=button value="getDataFromServer" onclick="getDataFromServer0()"><br>
    Name<input name=b0 disabled><br>
    window.showModelessDialog方式:尽管不是很友好,但它是非模态的,并且无安全限制<br><br>Code<input name=a1 onchange="getDataFromServer1()" ><input type=button value="getDataFromServer" onclick="getDataFromServer1()"><br>
    Name<input name=b1 disabled><br>
    window.showModalDialog方式:模态,无安全限制<br><br>
    <IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" />
    Code<input name=a2 onchange="getDataFromServer2()" ><input type=button value="getDataFromServer" onclick="getDataFromServer2()"><br>
    Name<input name=b2 disabled><br>
    oDownload.startDownload方式:非模态,无安全限制<br><br>Code<input name=a3 onchange="getDataFromServer3()" ><input type=button value="getDataFromServer" onclick="getDataFromServer3()"><br>
    Name<input name=b3 disabled><br>
    Microsoft.XMLHTTP方式:模态,代码与界面都挺友好,不过如果取数据页面反应很慢,则效果有所折扣。<br><br></body></html>
    <script>
    function getDataFromServer0()
    {
    document.all.b0.value="";
    window.showModelessDialog("getDataFromServerDialog.htm",document.all.b0,"status:no;resizable:no;help:no;dialogHeight:30px;dialogWidth:200px;");
    }function getDataFromServer1()
    {
    document.all.b1.value="";
    window.showModalDialog("getDataFromServerDialog.htm",document.all.b1,"status:no;resizable:no;help:no;dialogHeight:30px;dialogWidth:200px;");
    }
    function getDataFromServer2()
    {
    document.all.b2.value="";
    oDownload.startDownload('getDataFromServerDownload.htm',setB2Value);
    }function setB2Value(v)
    {
    document.all.b2.value=v;
    }function getDataFromServer3()
    {
    document.all.b3.value="";
    var theXmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
    theXmlHttp .open( "get", "getDataFromServerDownload.htm", false );
    theXmlHttp .send();
    document.all.b3.value=theXmlHttp.responseText;
    }
    </script>
      

  2.   

    我没有试过,但理论上可以,就是套一个Iframe,将表单提交到Iframe里面,由这个页进行刷新,然后再用javascript将值带回来,就实现此页不刷新而更新数据了,当然,这个Iframe页面可以设为宽高都是0,只是一个思路,没试过,有兴趣你可以试试
      

  3.   

    看看这个页,无刷新
    http://www.npggw.com/ftp/ytcm/main.asp
      

  4.   

    JK_10000(JK) ( ) 
    的方法帮我把问题解决了,非常感谢,分数都给你了
    并请教我用了第三种方法,有什么局限性吗?
      

  5.   

    oDownload.startDownload 很少见有人使用,JK也不大清楚它的局限性,如果你要用的话,最好自己去查一查资料作一些深入了解。
    Microsoft.XMLHTTP方式是最常用的方式,比较成熟,它的优缺点大家都很明白。
      

  6.   

    再次感谢了。oDownload.startDownload给我感觉速度很快,我自己去找找资料看看