Javascript Can';在IE11中添加html

Javascript Can';在IE11中添加html,javascript,jquery,append,internet-explorer-11,Javascript,Jquery,Append,Internet Explorer 11,我编写了一个代码来遍历一个表,并在特定列中对每个数字进行合计。在Chrome/Firefox/Safari甚至IE 9和IE 10中,一切都运行良好。但这在IE11中不起作用。代码不附加句子 这是密码 jQuery(document).ready(function(){ total = 0; total_continue = 0; jQuery('#qqp_profile_meta_box_r_profile_formation table tbody tr').eac

我编写了一个代码来遍历一个表,并在特定列中对每个数字进行合计。在Chrome/Firefox/Safari甚至IE 9和IE 10中,一切都运行良好。但这在IE11中不起作用。代码不附加句子

这是密码

jQuery(document).ready(function(){

    total = 0;
    total_continue = 0;
    jQuery('#qqp_profile_meta_box_r_profile_formation table tbody tr').each(function(){
        if(jQuery(this).hasClass('the_header_row') || jQuery(this).hasClass('the_template_row') || jQuery(this).hasClass('the_final_row') ){
            // Nothing for the moment
        }else{
            total = parseFloat(total) + parseFloat($('td input',this).val());
        }

    });

    jQuery('#qqp_profile_meta_box_r_profile_formation').append("<p class='total-heure-formation' style='margin-left:63%;font-size:12px;font-weight:bold'>Total : " + total +  " heures de formation</p>");
    jQuery('#qqp_profile_meta_box_r_profile_formation').append("<p class='total-heure-formation-continue' style='margin-left:63%;font-size:12px;font-weight:bold'>Total : " + total_continue +  " heures de formation continue (" + total_continue * 2.0 + " unités)</p>");
    jQuery('#qqp_profile_meta_box_r_profile_formation').append("<input name='total-heure-formation-continue' class='input-formation-continue' type='hidden' value='" + total_continue + "' /> ");
});
jQuery(文档).ready(函数(){
总数=0;
总数=0;
jQuery('#qqp_profile_meta_box_r_profile_formation table tbody tr')。每个(函数(){
if(jQuery(this).hasClass(_header_row')| | jQuery(this).hasClass(_template_row')| | jQuery(this).hasClass(_final_row')){
//暂时没有
}否则{
total=parseFloat(total)+parseFloat($('td input',this.val());
}
});
jQuery(“#qp_profile_meta_box_r_profile_formation”)。追加(

total:“+total+”heures-de-formation

”; jQuery(“#qqp_profile_meta_box_r_profile_formation”)。追加(

total:“+total_continue+”heures de formation continue(“+total_continue*2.0+”单位)

”; jQuery(“#qqp_profile_meta_box_r_profile_formation”)。追加(“”); });
更新:


我真的无法解释。但是当我删除.ready函数时,它起了作用。

浏览器控制台中是否报告了错误?当你说“你不能在IE11中追加”时,到底发生了什么?什么都没有?控制台中是否有任何错误?可能还应使用
var
声明
total
total\u continue
。浏览器控制台中没有与代码相关的错误。