I want to add IE8 support to my website but my website uses jquery v.2 that isn't supported by IE8. So i want to load jquery v.1 for users with IE8, but this doesn't work, can anyone see the mistake in my code?
When i visit the website in IE8 i get hundreds of errors because it is loading ONLY v.2 … . On the other hand safari is NOT loading v.1, so only IE has a problem here.
echo '<!--[if lt IE 9]>';
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', get_stylesheet_directory_uri() . "/_plugins/jquery/jquery-1.11.3.min.js", false, false, false );
wp_enqueue_script( 'jquery' );
echo '<![endif]-->';
echo '<!--[if gte IE 9]><!-->';
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', get_stylesheet_directory_uri() . "/_plugins/jquery/jquery-2.1.4.min.js", false, false, false );
wp_enqueue_script( 'jquery' );
echo '<!--<![endif]-->';