In a WordPress theme, how do you conditionally include scripts for ie8 and below? This is primarily to apply polyfills for various html5/css3 features. I see that wp has the $is
Update for WordPress 4.7.3 with scripts loading from CDN:
add_action( 'wp_enqueue_scripts', 'load_IE_fallback' );
function load_IE_fallback() {
wp_register_script( 'ie_html5shiv', 'https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js', '', '3.7.3', false );
wp_register_script( 'ie_respond', 'https://oss.maxcdn.com/respond/1.4.2/respond.min.js', '', '1.4.2', false );
wp_enqueue_script( 'ie_html5shiv');
wp_enqueue_script( 'ie_respond');
wp_script_add_data( 'ie_html5shiv', 'conditional', 'lt IE 9' );
wp_script_add_data( 'ie_respond', 'conditional', 'lt IE 9' );
}