该法典在hr/ff/ie9 进行,但并非e8/7。
http://jsfiddle.net/vDZJM/6/>rel=“nofollow> http://jsfiddle.net/vDZJM/6/。
Here is the JS:
function doDistricts(theData){
var district="";
var district="";
$(theData).find("district").each(function(){
var theDistrict = $(this);
var districtName = theDistrict.text();
var level = theDistrict.attr("level");
var attr = theDistrict.attr( deleted );
if(typeof attr !== undefined && attr !== false){
district=district+ <div class="district deleted">
;
district=district+ <header class="clearfix doNode" data-role-id=" +districtName+ " data-role-nodeLevel=" +level+ " data-role-nodeValue=" +districtName+ ">
;
district=district+ <span class="arrow"></span>
;
district=district+ <img src="/img/address_list/map.png" alt=" +districtName+ " class="icon" />
;
district=district+ <span class="text"> +districtName+ </span>
;
district=district+ <a class="add" href="#">Add</a>
;
district=district+ </header>
;
district=district+ <div class="children"></div>
;
district=district+ </div>
;
}else{
district=district+ <div class="district">
;
district=district+ <header class="clearfix doNode" data-role-nodeLevel=" +level+ " data-role-id=" +districtName+ " data-role-nodeValue=" +districtName+ ">
;
district=district+ <span class="arrow"></span>
;
district=district+ <img src="/img/address_list/map.png" alt=" +districtName+ " class="icon" />
;
district=district+ <span class="text"> +districtName+ </span>
;
district=district+ <a class="remove" href="#">Remove</a>
;
district=district+ </header>
;
district=district+ <div class="children"></div>
;
district=district+ </div>
;
}
});
return district;
}
$( div.1 ).html(doDistricts($(theData)));
在具有更多代码的工作环境中,内容生成,但<代码><header>tag过早关闭,即应在<代码><内的所有代码;header> tag(<span=“ar”>
等)实际上不在此限。 为什么这样做?