caoyinghui

          模式窗口的使用

          <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <script>  //補充完成下邊的函數(shù),打開新的一個模式窗口  function openShowModalDialog(){      var obj = window;      var params  = new Array("aaaa",obj);

            var returnValue = window.showModalDialog("DEMO04_01.html",params);

            document.getElementById("showContentDiv").innerHTML=returnValue;

           }

            </script>

          </head>

          <body>

          <h1>模式窗口的使用:</h1> <h3>補充完成openShowModalDialog函數(shù),打開新的一個模式窗口</h3> <button onclick="openShowModalDialog();">打開新的模式窗口</button> <br> <hr> <div id="showContentDiv">

          </div>   </body> </html>

          DEM004-01.html

          <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head>

          <script>

           //補充完成函數(shù),將文本框returnValue的值設置為父窗口返回值,并關閉本窗口  function closeShowModalDialog(){        //獲得模式窗體的參數(shù)。         var p = window.dialogArguments;          window.returnValue=document.getElementById("returnValue").value;      //設置父窗體的返回值 p[1] 事實上是拿到了父窗體的引用      p[1].returnValue=document.getElementById("returnValue").value;

               window.close();  }   </script>

          </head>

          <body>

          <h1>模式窗口的使用:</h1> <h3>補充完成closeShowModalDialog函數(shù),將文本框returnValue的值設置為父窗口返回值,并關閉本窗口</h3> <button onclick="closeShowModalDialog();">設置返回值,并關閉窗口</button> <hr> 窗口的返回值 <input type="text" id="returnValue" value="在這里設置返回值">   </body> </html>

          作者:caoyinghui1986 發(fā)表于2008-6-15 12:27:00 原文鏈接
          閱讀:365 評論:0 查看評論

          posted on 2008-06-15 04:27 shine_panda 閱讀(436) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          <2008年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          導航

          統(tǒng)計

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 赤峰市| 砚山县| 靖边县| 松江区| 大城县| 钟祥市| 图木舒克市| 昆明市| 磐安县| 兴隆县| 齐河县| 墨玉县| 鸡泽县| 黎城县| 八宿县| 长白| 江孜县| 新兴县| 上犹县| 淮安市| 裕民县| 湖北省| 葫芦岛市| 台中县| 吉首市| 嘉荫县| 美姑县| 万荣县| 宁化县| 遵义市| 于都县| 大埔区| 墨江| 报价| 松阳县| 大安市| 新民市| 哈尔滨市| 汝阳县| 南部县| 郑州市|