JQuery UI autocomplete works in Firefox but not in IE

I have a new autocomplete widget in jQuery UI 1.8rc3 that works fine in Firefox. This does not work at all in IE. Can anybody help me?

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.

NHbBl.jpg

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 the jquery.min.js file. Please note that I am using jQuery version 1.4.2 hosted on Google servers ( https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js ).

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

Once again, this works in Firefox, but not in IE. Any suggestions?

Thank you

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

UPDATE 2: I found that jQuery UI auto- this.element.height uses the invalid this.element.height property when it should use this.element.height() function

+4
source share
2 answers

If I understand correctly that the line you are referring to looks like line 4618 in the jquery.1.4.2.js in the style function. This can only mean that the Autocompleter plugin is trying to set a style value that IE8 does not understand or does not allow it to access / change in this way.

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

I have exactly the same error on the same line, but for a completely different deal. That is, I do not do anything with autocomplete; rather, mine happens because I'm trying this in jQuery ...

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

What jQuery is trying to do ...

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

And this, of course, does not work, because rgba is not supported by the CSS value for Internet Explorer. So you are not alone in this, but in my case, I just did it wrong. The relevant jQuery syntax is ...

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

Here is my source ...

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

+1
source

Source: https://habr.com/ru/post/1304281/


All Articles