<script>
$(document).ready(function() {
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(fun /*, thisp*/){
var len = this.length;
if (typeof fun != "function")
throw new TypeError();
var thisp = arguments[1];
for (var i = 0; i < len; i++){
if (i in this)
fun.call(thisp, this[i], i, this);
}
};
}
var jt=$("#jt").val();
var arrjt=jt.split(/,|,/);
var arrjtA=[];
var jtemp="";
for(i=0;i<arrjt.length;i++){
arrjtA.push(arrjt[i]);
}
arrjtA.forEach(function(e){
jtemp+="<div class='swiper-slide'><img src='images/"+e+"'/></div>";
});
$("#screenshot").html(jtemp);
var tz=$("#tz").val();
var arrtz=tz.split(/;|;/);
var arrtzA=[];
var temp="";
for(j=0;j<arrtz.length;j++){
arrtzA.push(arrtz[j]);
}
arrtzA.forEach(function(e){
temp+="<li class='xinban'>▪"+e+"</li>";
});
$("#feature").html(temp);
});
</script>
<input type="hidden" >
</div>
<input type="hidden" >
</ul>
部分来自:http://segmentfault.com/a/1190000002486377