I ran into a problem with jQuery UI - Autocomplete and IE8.
I use the combobox
method, which you can find on the jQuery UI website - here
Basically, it creates an autocomplete input + a select menu from the select/option
list.
I am using jQuery 1.6.4 and jQuery UI 1.8.16; as from google server.
It works fine on Chrome / FF / Opera, but does not work on IE8.
In IE8 - as soon as you select something (after entering) or use the drop-down button, IE will reload the page. Please, not that IE will not break until you click the arrows or try to choose something.
res://ieframe.dll/acr_error.htm#,
in the URL, before the actual path- or
this tab has been reloaded; a problem with the page causes IE to close and reopen the page
message this tab has been reloaded; a problem with the page causes IE to close and reopen the page
this tab has been reloaded; a problem with the page causes IE to close and reopen the page
Real time example
Any idea what makes IE act like this? Any suggestion is much appreciated.
JQuery Code:
<script> (function( $ ) { $.widget( "ui.combobox", { _create: function() { var self = this, select = this.element.hide(), selected = select.children( ":selected" ), value = selected.val() ? selected.text() : ""; var input = this.input = $( "<input>" ) .insertAfter( select ) .val( value ) .autocomplete({ delay: 0, minLength: 0, source: function( request, response ) { var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); response( select.children( "option" ).map(function() { var text = $( this ).text(); if ( this.value && ( !request.term || matcher.test(text) ) ) return { label: text.replace( new RegExp( "(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi" ), "<strong>$1</strong>" ), value: text, option: this }; }) ); }, select: function( event, ui ) { ui.item.option.selected = true; self._trigger( "selected", event, { item: ui.item.option }); }, change: function( event, ui ) { if ( !ui.item ) { var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ), valid = false; select.children( "option" ).each(function() { if ( $( this ).text().match( matcher ) ) { this.selected = valid = true; return false; } }); if ( !valid ) { </script>