码迷,mamicode.com
首页 > Web开发 > 详细

JS 动态加载页面以及ViewBag传参

时间:2017-08-22 16:05:24      阅读:1300      评论:0      收藏:0      [点我收藏+]

标签:comment   style   comm   tar   resize   default   his   pid   none   

<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+‘&nbsp;&nbsp;:&nbsp;&nbsp;</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传参

标签:comment   style   comm   tar   resize   default   his   pid   none   

原文地址:http://www.cnblogs.com/yishilin/p/7411557.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!