"<div class="row-fluid" height="400px">………… class 属性的双引号,改成单引号。 或者使用+号连接符
var array=[]; function clk(){ var config=jQuery("#compare").select().val(); alert(config); var dataconfig=array[config]; jQuery("#last").empty(); document.getElementById("last").innerHTML='<div class="row-fluid" height="400px"><div id="'+config+'" unit="'+${dev.unit}+'" data-config="'+dataconfig+'" class="span10" style="height:400px"></div></div>';}
class 属性的双引号,改成单引号。
或者使用+号连接符
var array=[];
function clk(){
var config=jQuery("#compare").select().val();
alert(config);
var dataconfig=array[config];
jQuery("#last").empty();
document.getElementById("last").innerHTML='<div class="row-fluid" height="400px"><div id="'+config+'" unit="'+${dev.unit}+'" data-config="'+dataconfig+'" class="span10" style="height:400px"></div></div>';}