views:

483

answers:

2

Hello all, I am using jquery ui autocomplete it is working absolutely fine in all browsers except ie8.

I have been doing some testing and there seems to be a strange bug. When I click on a link leading to the relevant page there is the following error generated by ie8 when I start typing in the autocomplete box:

'object doesn't support this property or method' this error points to my development jquery(1.4.2) file at line 4955, char 5 which is the following line: return new window.XMLHttpRequest();

However, if I simply reload the page the autocomplete works.

I have added a random bit of data to be called with the autocomplete as I read that ie8 caches it ajax get requests but this does not seem to have solved the problem.

Could there be a problem with the timing of the loading of all the relevant files including jquery? If so, how would I fix this? Any other clever ideas?!

Andy

+2  A: 

Sounds like you are trying to use the asynchronous Ajax-call synchronously.

You should use a callback-function in which you retreive the data.

= or =

You should configure the call to be synchronous:

jQuery.ajax( {async: false} );
edwin
A: 

Ok,

After lots of trial and error I found the answer to be very simple!

I was calling the meta tag...

...after the javascript include files. All other browsers except IE8 allowed this.

That'll be a lesson I won't forget soon - many hours spent fixing!

Andy

Andy Simpson