arame3333
arame3333

Reputation: 10193

Unhandled exception in jquery-ui-1.10.0.js. 0x800a138f - Microsoft JScript runtime error: Object expected

I am developing my ASP-MVC application in ie9, and when I load the first login page I get this error;

Unhandled exception at line 6953, column 7 in .../Scripts/jquery-ui-1.10.0.js

0x800a138f - Microsoft JScript runtime error: Object expected

I look inside the JQuery-ui-1.10.0.js file and I find this code;

_search: function( value ) {
        this.pending++;
        this.element.addClass( "ui-autocomplete-loading" );
        this.cancelSearch = false;

            this.source( { term: value }, this._response() );
    },

I find that reason this happens is because;

this.source is set to null. 

But I haven't been able to find out why this is and how to fix it.

I have tried to locate where this.source is set. I found this code in jquery-ui;

_initSource: function() {
        var array, url,
            that = this;
        if ( $.isArray(this.options.source) ) {
            array = this.options.source;
            this.source = function( request, response ) {
                response( $.ui.autocomplete.filter( array, request.term ) );
            };
        } else if ( typeof this.options.source === "string" ) {
            url = this.options.source;
            this.source = function( request, response ) {
                if ( that.xhr ) {
                    that.xhr.abort();
                }
                that.xhr = $.ajax({
                    url: url,
                    data: request,
                    dataType: "json",
                    success: function( data ) {
                        response( data );
                    },
                    error: function() {
                        response( [] );
                    }
                });
            };
        } else {
            **this.source = this.options.source;**
        }

I have highlighted the code that is executed (ie the 3rd branch) and where this.source is set to null. I have not been able to trace back any further than that.

My View Source is;

<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]> <html class="no-js" lang="en"> <!--<![endif]-->
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>SCD</title>
    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    <link rel="SHORTCUT ICON" href="/favicon.ico" />

    <link href="/dataTables/css/AutoFill.css" rel="stylesheet"/>
<link href="/dataTables/css/demo_page.css" rel="stylesheet"/>
<link href="/dataTables/css/demo_table.css" rel="stylesheet"/>
<link href="/dataTables/css/demo_table_jui.css" rel="stylesheet"/>
<link href="/dataTables/css/jquery.dataTables.css" rel="stylesheet"/>
<link href="/dataTables/css/jquery.dataTables_themeroller.css" rel="stylesheet"/>
<link href="/dataTables/css/TableTools.css" rel="stylesheet"/>
<link href="/dataTables/css/TableTools_JUI.css" rel="stylesheet"/>

    <link href="/Content/superfish.css" rel="stylesheet"/>
<link href="/Content/superfish-navbar.css" rel="stylesheet"/>


    <link href="/Content/themes/sunny/jquery-ui.css" rel="stylesheet"/>
<link href="/Content/themes/sunny/jquery.ui.theme.css" rel="stylesheet"/>

    <link href="/Content/demos.css" rel="stylesheet"/>

    <link href="/Content/jquery.mobile-1.2.0.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.structure-1.2.0.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.theme-1.2.0.css" rel="stylesheet"/>

    <link href="/Content/PagedList.css" rel="stylesheet"/>

    <link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap-responsive.css" rel="stylesheet"/>

    <link href="/Content/Site.css" rel="stylesheet"/>

    <link href="/Content/jquery.jqGrid/ui.jqgrid.css" rel="stylesheet"/>

    <script src="/Scripts/modernizr-2.0.6-development-only.js"></script>
<script src="/Scripts/modernizr-2.6.2.js"></script>

</head>

<body>
    <div class="page">

        <section class="main-content">


<hgroup class="title">
    <span style="margin-left:40px;"><h2>Log in.</h2></span>
</hgroup>

<section>

<form action="/" method="post"><input name="__RequestVerificationToken" type="hidden" value="I-FFb6bdAvkOOiAvXXU3kBC2f8ovY_xH2Y0tG4craWHUa6oVcHH-V6zi2kJy4luADvcRN6e_EC9vyIA8QnIWSnocZqnRFV79uVl_3s_BndjE_3R2P0MFJMpsLfA0yte4_N4hyNXQj3livH-2fNZGmKnZGQscE-Qj6GbSIRivn6A1" />        <div id="logon">
            <fieldset>
                <legend>Account Information</legend>

                <div class="editor-label">
                    <label for="UserName">User name</label>
                </div>
                <div class="editor-field">
                    <input data-val="true" data-val-required="The User name field is required." id="UserName" name="UserName" type="text" value="geoffreypayne" /> 
                    <span class="field-validation-valid" data-valmsg-for="UserName" data-valmsg-replace="true"></span>
                </div>

                <div class="editor-label">
                    <label for="Password">Password</label>
                </div>
                <div class="editor-field">
                    <input data-val="true" data-val-required="The Password field is required." id="Password" name="Password" type="password" />
                    <span class="field-validation-valid" data-valmsg-for="Password" data-valmsg-replace="true"></span>
                </div>

                <div class="editor-label">
                    <input data-val="true" data-val-required="The Remember me? field is required." id="RememberMe" name="RememberMe" type="checkbox" value="true" /><input name="RememberMe" type="hidden" value="false" /> 
                    <label for="RememberMe">Remember me?</label>
                </div>

                <p>
                    <input type="submit" class="btnSubmit" value="Log On" />
                </p>
            </fieldset>
        </div>
</form>
    </div>
    <script src="/Scripts/jquery-1.9.1.js"></script>
<script src="/Scripts/jquery-migrate-1.1.1.js"></script>
<script src="/Scripts/jquery-ui-1.10.4.js"></script>
<script src="/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/Scripts/jquery.calculation.js"></script>
<script src="/Scripts/jquery.columnizer.js"></script>
<script src="/Scripts/jquery.MultiFile.js"></script>
<script src="/Scripts/jquery.printElement.js"></script>
<script src="/Scripts/jquery.hotkeys.js"></script>
<script src="/Scripts/jquery.tablesorter.js"></script>
<script src="/Scripts/jquery.tablesorter.pager.js"></script>
<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/scd.js"></script>
<script src="/Scripts/dataservice.js"></script>
<script src="/Scripts/popupservice.js"></script>
<script src="/Scripts/hoverIntent.js"></script>
<script src="/Scripts/superfish.js"></script>
<script src="/Scripts/supersubs.js"></script>
<script src="/Scripts/AjaxLogin.js"></script>
<script src="/Scripts/jqprint.js"></script>

    <script src="/dataTables/Scripts/jquery.dataTables.js"></script>
<script src="/dataTables/Scripts/TableTools.js"></script>
<script src="/dataTables/Scripts/ZeroClipboard.js"></script>
<script src="/dataTables/Scripts/jquery.jeditable.js"></script>
<script src="/dataTables/Scripts/jquery.dataTables.editable.js"></script>

    <script src="/Scripts/scd-basket.js"></script>
<script src="/Scripts/scd-search.js"></script>
<script src="/Scripts/scd-companyDetail.js"></script>


    <script src="/Scripts/SCD/LogOn.js"></script>
<script src="/Scripts/CapsLock.compressed.js"></script>


</body>
</html>

Upvotes: 2

Views: 2411

Answers (1)

Irvin Dominin
Irvin Dominin

Reputation: 30993

With the current informations, I think the problem is that the autocomplete is attached to every input tag, and not for all there is a source option defined.

A possibile solution is to add a specific class to the fields that will host autocomplete fieldAutocomplete then use a more restrictive selector to attach autocomplete only to elements that have that class.

Like:

$( "input.fieldAutocomplete" ).autocomplete({
});

Upvotes: 2

Related Questions