简体   繁体   English

jQuery不会在Internet Explorer 10上加载页面加载; 仅加载页面刷新(F5)

[英]jQuery does not load on page load on Internet Explorer 10; only loads on page refresh (F5)

jQuery does not load on page load in Internet Explorer 10 and have to press (F5) / or refresh the page for it to load. jQuery在Internet Explorer 10中无法在页面加载时加载,而必须按(F5)/或刷新页面才能加载。 On Chrome and Firefox it loads perfectly; 在Chrome和Firefox上,它可以完美加载; it's just IE that's causing the issue. 只是IE引起了问题。 It seems to be like jQzoom is causing the issue because that the only script is failing to load on page load. 似乎是jQzoom导致了此问题,因为唯一的脚本无法在页面加载时加载。

jQzoom Script: jQzoom脚本:

$(document).ready(function() {
$('.jqzoom').jqzoom({
        zoomType: 'standard',
        lens:true,
        preloadImages: false,
        alwaysOn:false
    });
});

Function that I am using to link all the jQueries: 我用来链接所有jQueries的函数:

'jQzoom2' is the script mentioned above: “ jQzoom2”是上面提到的脚本:

function et_load_lucid_scripts(){
if ( !is_admin() ){
    $template_dir = get_template_directory_uri();
    wp_enqueue_script('sc1', $template_dir . '/js/scroll/jquery-1.3.2.js', array('jquery'), '1.0', true);
    wp_enqueue_script('sc2', $template_dir . '/js/scroll/scroll-startstop.events.jquery.js', array('jquery'), '1.0', true);
    wp_enqueue_script('jqzoom2', $template_dir . '/js/jq/jqzoom2.js', array('jquery'), '1.0', true);
    wp_enqueue_script('navigation', $template_dir . '/js/navigation/jquery1.js', array('jquery'), '1.0', true);
    wp_enqueue_script('navigation1', $template_dir . '/js/navigation/nav_touch.js', array('jquery'), '1.0', true);
    wp_enqueue_script('jqzoom1', $template_dir . '/js/jq/jquery.jqzoom-core.js', array('jquery'), '1.0', true);
    wp_enqueue_script('tracklist', $template_dir . '/js/test/jquery.dataTables.min.js', array('jquery'), '1.0', true);
    wp_enqueue_script('new_tab', $template_dir . '/js/test/newtab.js', array('jquery'), '1.0', true);
    wp_enqueue_script('html5', $template_dir . '/js/html5.js', array('jquery'), '1.0', true);
    wp_enqueue_script('superfish', $template_dir . '/js/superfish.js', array('jquery'), '1.0', true);
    wp_enqueue_script('flexslider', $template_dir . '/js/jquery.flexslider-min.js', array('jquery'), '1.0', true);
    wp_enqueue_script('fitvids', $template_dir . '/js/jquery.fitvids.js', array('jquery'), '1.0', true);
    wp_enqueue_script('custom_script', $template_dir . '/js/custom.js', array('jquery'), '1.0', true);
}
if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' );

    $et_gf_enqueue_fonts = array();
    $et_gf_heading_font = sanitize_text_field( et_get_option( 'heading_font', 'none' ) );
    $et_gf_body_font = sanitize_text_field( et_get_option( 'body_font', 'none' ) );

    if ( 'none' != $et_gf_heading_font ) $et_gf_enqueue_fonts[] = $et_gf_heading_font;
    if ( 'none' != $et_gf_body_font ) $et_gf_enqueue_fonts[] = $et_gf_body_font;
    if ( ! empty( $et_gf_enqueue_fonts ) ) et_gf_enqueue_fonts( $et_gf_enqueue_fonts );
} 

add_action( 'wp_enqueue_scripts', 'et_load_lucid_scripts' );

Add <meta http-equiv="X-UA-Compatible" content="IE=10"> into the head of your page. 将<meta http-equiv =“ X-UA-Compatible” content =“ IE = 10”>添加到页面顶部。

This may also fix other js issues with content sliders and images. 这也可以解决其他与内容滑块和图像有关的js问题。 Cheers 干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM