Question

I've got the new autocomplete widget in jQuery UI 1.8rc3 working great in Firefox. It doesn't work at all in IE. Can someone help me out?

HTML:

<input type="text" id="ctrSearch" size="30">
<input type="hidden" id="ctrId">

Javascript:

$("#ctrSearch").autocomplete({
    source: "ctrSearch.do",
    minLength: 3,
    focus: function(event, ui){
        $('#ctrSearch').val(ui.item.ctrLastName + ", " + ui.item.ctrFirstName);
        return false;
    },
    select: function(event, ui){
        $('#ctrId').val(ui.item.ctrId);
        return false;
    }
});

Result (IE 8):

The red box is the <ul> element created by jQuery.

I also get this error:

Line: 116
Error: Invalid argument.

When I open it in the IE8 script debugger, it highlights f[b]=d on line 116 of jquery.min.js. Note that I'm using version 1.4.2 of jQuery hosted on Google's servers (https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js).

I've tried removing some of the options, but even when I call .autocomplete() with no options, or with only the source option, I still get the same result.

Once again, it's working in Firefox, but not in IE. Any suggestions?

Thanks.

UPDATE: As suggested, I used jquery.js (instead of jquery.min.js) and got the error on line 4618. See jitter's answer below. Please see this other Stack Overflow question that was posted a few days ago.

UPDATE 2: I discovered that jQuery UI autocomplete uses an invalid property this.element.height, when it should be using the function this.element.height()

Was it helpful?

Solution

If I understand this right the line you refer to seems to be the line 4618 in jquery.1.4.2.js in the style function. Which can only mean that the Autocompleter plugin tries to set a style value that IE8 doesn't understand or doesn't allow to be accessed/changed in this way.

style[ name ] = value; //style == elem.style from the passed in element

OTHER TIPS

I have the exact same error on the exact same line, but for a completely different deal. That is, I'm not doing anything having to do with auto-complete; rather, mine occurs because I'm trying this in jQuery...

$(this).css('background', 'rgba(64,255,64,.4)');

Which jQuery tries to do...

style [ 'background' ] = 'rgba(64,255,64,.4)';

And it fails, of course, because rgba is not a supported CSS value for Internet Explorer. So you're not alone on this one, but in my case I was just doing it wrong. The appropriate jQuery syntax is this...

$(this).css({backgroundColor: '#40ff40', opacity: .4});

Here's my source...

http://www.cjs.me.uk/blog/?p=238

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top