js for循环 添加html代码

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

###for循环代码 for(var i=0;i"+ ''+ "

"+ "
"+ ""+ "
";//结束开始做js判断 if(displayShow == true){ innerHTML+= '是'; }else{ innerHTML+= '是'; } innerHTML+= "
"+ "
"+ "
"+ '
';

        }
        $("#bannerPicture").html(innerHTML);

  request请求
    //是否显示轮播图
    function displayBlock(event,id,displayShow){
        console.log(event);
        console.log(id);
        var show;
        if(displayShow == "true"){
            show = false;
           }else{

            show = true;
        }
    $.ajax({

        type:'POST',
        url:pengPengUrl+"/cmsComm/showBannerPic",
        dataType:"json",
        data:{bannerId:id,show:show},
        success:function(res){

            if(res.statusCode == 200){

                console.log(res);
                alert("修改成功");
                bannerPicList();
            }
        },
        error:function(){

            console.log("修改图片失败");
        }
    })

}

转载于:https://my.oschina.net/pingheyongfeng/blog/983550

你可能感兴趣的:(js for循环 添加html代码)