【问题标题】:simple modal pop up not working in ie 10.0?简单的模式弹出在 ie 10.0 中不起作用?
【发布时间】:2013-07-15 10:31:58
【问题描述】:

我正在使用简单的模态 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 插件是否存在任何兼容性问题,非常感谢任何帮助。

非常感谢

【问题讨论】:

    标签: jquery asp.net-mvc html internet-explorer simplemodal


    【解决方案1】:

    请参阅 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 再次出现此问题

    【讨论】:

      【解决方案2】:

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

      SimpleModal Bug in IE

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多