首页 > 编程语言 > 详细

javascript 语法问题:

时间:2018-07-13 20:44:03      阅读:190      评论:0      收藏:0      [点我收藏+]

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 语法问题:

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!