js showModalDialog參數(shù)的使用詳解
基本介紹:
showModalDialog() (IE 4+ 支持)
showModelessDialog() (IE 5+ 支持)
window.showModalDialog() 方法用來創(chuàng)建一個顯示HTML內容的模態(tài)對話框。
window.showModelessDialog() 方法用來創(chuàng)建一個顯示HTML內容的非模態(tài)對話框。
使用方法:
vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
參數(shù)說明:
sURL -- 必選參數(shù),類型:字符串。用來指定對話框要顯示的文檔的URL。
vArguments -- 可選參數(shù),類型:變體。用來向對話框傳遞參數(shù)。傳遞的參數(shù)類型不限,包括數(shù)組等。對話框通過window.dialogArguments來取得傳遞進來的參數(shù)。
sFeatures -- 可選參數(shù),類型:字符串。用來描述對話框的外觀等信息,可以使用以下的一個或幾個,用分號“;”隔開。
----------------
1. dialogHeight: 對話框高度,不小于100px
2. dialogWidth: 對話框寬度。
3. dialogLeft: 離屏幕左的距離。
4. dialogTop: 離屏幕上的距離。
5. center: { yes | no | 1 | 0 } : 是否居中,默認yes,但仍可以指定高度和寬度。
6. help: {yes | no | 1 | 0 }: 是否顯示幫助按鈕,默認yes。
7. resizable: {yes | no | 1 | 0 } [IE5+]: 是否可被改變大小。默認no。
8. status:{yes | no | 1 | 0 } [IE5+]:是否顯示狀態(tài)欄。默認為yes[ Modeless]或no[Modal]。
9. scroll:{ yes | no | 1 | 0 | on | off }:是否顯示滾動條。默認為yes。
下面幾個屬性是用在HTA中的,在一般的網(wǎng)頁中一般不使用。
10.dialogHide:{ yes | no | 1 | 0 | on | off }:在打印或者打印預覽時對話框是否隱藏。默認為no。
11. edge:{ sunken | raised }:指明對話框的邊框樣式。默認為raised。
12. unadorned:{ yes | no | 1 | 0 | on | off }:默認為no。
參數(shù)傳遞:
1.要想對話框傳遞參數(shù),是通過vArguments來進行傳遞的。類型不限制,對于字符串類型,最大為4096個字符。也可以傳遞對象,例如:
parent.htm
<script>
var obj = new Object();
obj.name="51js";
window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
</script>
modal.htm
<script>
var obj = window.dialogArguments
alert("您傳遞的參數(shù)為:" + obj.name)
</script>
2.可以通過window.returnValue向打開對話框的窗口返回信息,當然也可以是對象。例如:
parent.htm
<script>
str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px");
alert(str);
</script>
modal.htm
<script>
window.returnValue="http://www.dbjr.com.cn";
</script>
- javascript showModalDialog模態(tài)對話框使用說明
- js的window.showModalDialog及window.open用法實例分析
- Javascript showModalDialog兩個窗體之間傳值
- JS中showModalDialog 的使用解析
- javascript showModalDialog傳值與FireFox的window.open 父子窗口傳值示例
- js showModalDialog彈出窗口實例詳解
- javascript showModalDialog,open取得父窗口的方法
- JavaScript中window.showModalDialog()用法詳解
- javascript showModalDialog 多層模態(tài)窗口實現(xiàn)頁面提交及刷新的代碼
- JS對話框_JS模態(tài)對話框showModalDialog用法總結
- javascript showModalDialog 內跳轉頁面的問題
- js showModalDialog 彈出對話框的簡單實例(子窗體)
- JS中showModalDialog關閉子窗口刷新主窗口用法詳解
相關文章
JS實現(xiàn)將二維數(shù)組轉為json格式字符串操作示例
這篇文章主要介紹了JS實現(xiàn)將二維數(shù)組轉為json格式字符串操作,涉及javascript數(shù)組遍歷、拼接、轉換等相關操作技巧,需要的朋友可以參考下2018-07-07微信小程序搭建(mpvue+mpvue-weui+fly.js)的詳細步驟
這篇文章主要介紹了微信小程序搭建(mpvue+mpvue-weui+fly.js)的詳細步驟,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-09-09代碼短小的js div層拖動實現(xiàn)代碼[兼容IE與Firefox]
代碼短小的js div層拖動實現(xiàn)代碼[兼容IE與Firefox],需要的朋友可以參考下.2010-05-05基于JavaScript實現(xiàn)網(wǎng)頁計算器
這篇文章主要為大家詳細介紹了基于JavaScript實現(xiàn)網(wǎng)頁計算器,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2021-05-05