0

I'm using simple modal JQUERY plug-in for having pop ups in my MVC 4 website, its works fine with CHROME and FIREFOX but not in internet explorer v10.0, If I opened the site in IE it throws below java script error and modal popup not appearing

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'

In layout page I’m rendering the below scripts

<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>

Below is my Login.cshtml page

<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>

I’m not sure if there is any compatibility issue with simple modal and jquery plugins any help would be much appreciated.

Many Thanks

Umamaheswaran
  • 3,690
  • 3
  • 29
  • 56
  • Does this answer your question? [Simple Modal, jQuery 1.8.0 and IE9](https://stackoverflow.com/questions/12046242/simple-modal-jquery-1-8-0-and-ie9) – miken32 Oct 14 '22 at 17:57

1 Answers1

2

See the answer by Noah Lehmann-Haupt in this question: Simple Modal, jQuery 1.8.0 and IE9

You'll need to edit a line of the jquery.simplemodal

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

This problem has re-occurred for jQuery 1.10.1

Community
  • 1
  • 1
keeg
  • 3,990
  • 8
  • 49
  • 97