2016-06-13 60 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 

});