码迷,mamicode.com
首页 > 编程语言 > 详细

javascript 语法问题:

时间:2018-07-13 20:45:38      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:span   server   style   节点   col   nbsp   www   http   ast   

https://www.w3schools.com/js/tryit.asp?filename=tryjs_change_innerhtml

 

received: function(data) {
// Called when there‘s incoming data on the websocket for this channel
// document.getElementById("notifications").innerHTML = data.html;
// ??的只是取代,不能增加节点,我像知道如何增加子节点。
$("#notifications").prepend(data.html);
}

如何用原生js写出$("#notifications").prepend(data.html);

 备注:ActionCable.server.broadcast "notifications:11",

      {html: "<div>Hello world</div>"}

javascript 语法问题:

标签:span   server   style   节点   col   nbsp   www   http   ast   

原文地址:https://www.cnblogs.com/chentianwei/p/9307281.html

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