JS 動態載入頁面以及ViewBag傳參

來源:互聯網
上載者:User

標籤: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傳參

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.