2016-06-13 59 views

回答

0

我發現window.showmodaldialog not working in chrome但沒有多大幫助。但後來知道,我們需要使用window.open的Chrome作爲window.showModalDialog已棄用在Chrome 然後發現一些有用的信息http://javascript.about.com/library/blmodal.htm它的工作。

function modalWin() { 
if (window.showModalDialog) { 
window.showModalDialog("xpopupex.htm","name", 
"dialogWidth:255px;dialogHeight:250px"); 
} else { 
window.open('xpopupex.htm','name', 
'height=255,width=250,toolbar=no,directories=no,status=no, 
continued from previous linemenubar=no,scrollbars=no,resizable=no,modal=yes'); 
} 
} 
0

window.showModalDialog已從Web標準中棄用。您可以使用像https://github.com/niutech/showModalDialog這樣的填充並繼續正常使用。

function() { 

    //statements before showing a modal dialog 

    var returnValue = window.showModalDialog(url [, arguments, options]); 

    //statements after closing a modal dialog 

});