qq_Kk_56
2015-11-07 23:35
这里哪里错了
var g_tpl=function(id){
return g('tpl_'+id).innerHTML;
}
我也碰到过这样的问题后来发现我html里写的并非是id 而是class ,js读不到这个id值,不知道是否可以帮到你
var odiv=document.getElementById('text_father');
for(var i=0;i<text_one.length;i++){
odiv.innerHTML=odiv.innerHTML+'<div class="text_first_div_change_one col-xs-12 col-sm-12 col-md-12"style="padding: 0">'
+'<div class="info_img col-xs-2 col-sm-offset-2 col-md-2">'+' <img src="../images/tou1.png" alt="">'+
'</div>'+'<div class="info_detail_one col-xs-8 col-sm-8 col-md-8"style="padding: 0;">'+
'<div class="transpan col-xs-1 col-sm-1 col-md-1"></div>'+'<div class="text_detail col-xs-11 col-sm-11 col-md-11">' +text_one[i].text_one+
'</div>'+' </div>'+'</div>'+' <div class="text_first_div_change_two col-xs-12 col-sm-12 col-md-12">'+
' <div class="info_detail_two col-xs-10 col-sm-10 col-md-10"style="padding: 0">'+
'<div class="text_detail_two col-xs-11 col-sm-11 col-md-11">'+text_one[i].text_two+
' </div>'+'<div class="transpan_1 col-xs-1 col-sm-1 col-md-1"></div>'+' </div>'+'<div class="info_img_two col-xs-2 col-sm-2 col-md-2">'+
' <img src="../images/tou7.png" alt="">'+'</div>'+'</div>';
}
Pictrue_carousel_1.js:25 Uncaught TypeError: Cannot read property 'innerHTML' of null
是一个json数组的引用,这是哪里错了,为啥输不出来结果
QQ空间时光轴特效
29058 学习 · 119 问题