Note: I have only tried in IE8 and IE7 (via IE8 developer tools) as these are the only versions available to me.
I am using an ajax search plugin for Wordpress, the plugin can be found here: http://wordpress.org/extend/plugins/threewp-ajax-search/
It is working fantastically in firefox, however IE shows signs of making an ajax request and then failling. I have narrowed this down to IE recieving no results from the $.get()
function by using alert(ThreeWP_Ajax_Search.total_results);
which always alerts 0
even when other browsers get a number of results. Here is the section of the plugin which handles the ajax request:
$.get(url, function(data){
ThreeWP_Ajax_Search.results = $('.hentry', data);
// Remove extra elements if necessary
ThreeWP_Ajax_Search.total_results = ThreeWP_Ajax_Search.results.length;
alert(ThreeWP_Ajax_Search.total_results);
if ( ThreeWP_Ajax_Search.results.length > ThreeWP_Ajax_Search.options.results_to_display )
{
ThreeWP_Ajax_Search.results = ThreeWP_Ajax_Search.results.slice( 0, ThreeWP_Ajax_Search.options.results_to_display );
}
if ( ThreeWP_Ajax_Search.results.length < 1 )
ThreeWP_Ajax_Search.hide_results();
ThreeWP_Ajax_Search.do_callback(callback);
});
Note: url
is the standard Wordpress search url and is handled by the wordpress search engine. I have a few search plugins but they are all performed on the server-side.
I have also tried replacing $.get()
to $.ajax()
and setting cache: false
however that had no effect whatsoever.
Does anyone know what could be causing this issue?
A live example can be found at: http://rcnhca.org.uk/sites/first_steps/ (Searching for 'care' returns a number of results)
I believe the problem is the lack oF CORS support in IE7/IE8. Perhaps this might help?
http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
It seems like there is some conditional JS loaded when the browser is IE7 or IE8. The file is called "selectivizr-mis.js" and it is returning a 404 error when loaded.
Perhaps the IE7 and IE8 functionality of the site rely on something within this file in order to work correctly?
In either case that file should probably be loaded correctly.