JS 动态加载页面以及ViewBag传参
Posted Q & L
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JS 动态加载页面以及ViewBag传参相关的知识,希望对你有一定的参考价值。
<h2>JS 动态加载页面以及ViewBag传参</h2>
1 function setchildcomment(thisa, index){ 2 if(childcomments!=null) 3 { 4 console.log(childcomments); 5 var childhtml = ‘‘; 6 for(var i=0;i<childcomments.length;i++) 7 { 8 childhtml +=‘<div class="ff-sub-cmt col-md-offset-1 col-xs-offset-1">‘; 9 childhtml +=‘<div class="ff-sub-cmt-bar">‘; 10 childhtml +=‘<div class="ff-sub-u-name">‘; 11 childhtml +=‘<span style="float:left;">‘+childcomments[i].userName+‘ : </span>‘; 12 childhtml +=‘<span style="width: 500px; white-space: normal; word-wrap: break-word; display: inline-block; ">‘+childcomments[i].commentText+‘</span>‘; 13 childhtml +=‘<a class="sub-reply" onclick="huifu(this, 2)">回复</a>‘; 14 childhtml +=‘</div>‘; 15 childhtml +=‘<div class="row huifu" style="margin: 10px; display:none;">‘; 16 childhtml +=‘<textarea class="textarea-huifu" placeholder="回复:‘+childcomments[i].userName+‘" style="width: 90%; resize: none;" data-reply-pid></textarea>‘; 17 childhtml +=‘<button class="btn-fw btn btn-default" style="width: 10%;float:right;height:45px;" onclick="subminHuifu(this,@ViewBag.ArticleId,‘+childcomments[i].parentId+‘, ‘+index+‘, \‘‘+childcomments[i].userName+‘\‘, \‘‘+childcomments[i].commentText+‘\‘)">回复</button>‘; 18 childhtml +=‘</div>‘; 19 childhtml +=‘</div>‘; 20 childhtml +=‘</div>‘; 21 } 22 23 var childdiv = $(".ff-cmt:eq(" + index + ") .lookmore"); 24 $(childdiv).before(childhtml); 25 if(!childcomments[0].isMoreChild)//隐藏查看更多链接 26 { 27 thisa.style.display = "none"; 28 } 29 childcomments = null; 30 } 31 }
以上是关于JS 动态加载页面以及ViewBag传参的主要内容,如果未能解决你的问题,请参考以下文章