0

我正在使用简单的模态 JQUERY 插件在我的 MVC 4 网站中弹出窗口,它适用于 CHROME 和 FIREFOX 但不适用于 Internet Explorer v10.0,如果我在 IE 中打开该网站,它会抛出以下java 脚本错误和模态弹出窗口没有出现

Unhandled exception at line 16, column 133 in http://localhost:55939/Scripts/jquery.simplemodal.1.4.4.min.js
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'removeExpression'

在布局页面中,我正在渲染以下脚本

<script src="@Url.Content("~/Scripts/jquery-2.0.2.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.infieldlabel.min.js")" type="text/javascript"></script>

下面是我的 Login.cshtml 页面

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript" ></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript" ></script>
<script src="@Url.Content("~/Scripts/jquery.simplemodal.1.4.4.min.js")" type="text/javascript" ></script>


<div id="login" class="modal">

    @using (Html.BeginForm())
    {
        <p class="heading"><u>Sign in to your Account</u></p>
        <p>
            @Html.LabelFor(m => m.Username, new { @class = "inlabel" })
            @Html.TextBoxFor(m => m.Username, new { @class = "infield" })
        </p>
        <p>
            @Html.LabelFor(m => m.Password, new { @class = "inlabel" })
            @Html.PasswordFor(m => m.Password, new { @class = "infield" })
        </p>
        <table class="errorMessage">
            <tr>
                <td height="10px">
                    @Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")
                </td>

            </tr>
        </table>
        <div>
            @Html.ActionLink("Forgot your password?", "ForgotPassword")
            <input type="submit" value="Sign In" class="submitButton" />
        </div>

    }

</div>


<script type="text/javascript">
    $(document).ready(function () {
        $("label").inFieldLabels();
        $("#login").modal({ overlayCss: { backgroundColor: '#CCCCCC' } });
    })
</script>

我不确定简单模式和 jquery 插件是否存在任何兼容性问题,任何帮助将不胜感激。

非常感谢

4

2 回答 2

2

请参阅 Noah Lehmann-Haupt 在此问题中的回答:Simple Modal, jQuery 1.8.0 and IE9

您需要编辑 jquery.simplemodal 的一行

 // (Line 239) $.support.boxModel is undefined if checked earlier
 //browser.ieQuirks = browser.msie && !$.support.boxModel;
 browser.ieQuirks = browser.msie && (document.compatMode === "BackCompat");

jQuery 1.10.1 再次出现此问题

于 2013-11-18T15:55:51.913 回答
0

问题是 IE 想要一切都很好和整洁。无论如何,这是一个错误,您可以在这里查看我在说什么

IE 中的 SimpleModal 错误

于 2013-07-15T10:37:32.497 回答