C# chrome新版本中的showmodalDialog问题
谷歌chrome在新版本中删除了showmodalDialog。 我的浏览器代码不起作用我该怎么解决我的问题C# chrome新版本中的showmodalDialog问题,c#,javascript,google-chrome,showmodaldialog,C#,Javascript,Google Chrome,Showmodaldialog,谷歌chrome在新版本中删除了showmodalDialog。 我的浏览器代码不起作用我该怎么解决我的问题 function AddTime(OfferTime) { var x = new Array(); var ClsPartColeg = document.getElementById("ClassParam").value; x[0] = SrcName(ClsPartColeg, 'PartCombo'); if (OfferTime)
function AddTime(OfferTime) {
var x = new Array();
var ClsPartColeg = document.getElementById("ClassParam").value;
x[0] = SrcName(ClsPartColeg, 'PartCombo');
if (OfferTime)
x[1] = OfferTime;
else
x[1] = '$$0$' + SrcName(ClsPartColeg, 'College') + '$';
var s = showModalDialog("../HtmlPage/ClsTime.htm", x, "status:0;help:0;dialogWidth:420px;dialogHeight:100px");
if (s)
Perform('NewTime;Item=' + s);
}
您有两个选择:
1-使用jQuery软模式插件,即使用iframe显示模式URL,并添加阻止层,以防止用户与父页面交互
2-使用窗口打开模态。打开并使用onblur和onload将焦点保持在模态页面上,直到用户关闭它
<body onblur="self.focus()" onload="self.focus()">
第二种方法使用起来很烦人,我不推荐它