1. 程式人生 > >javascript 語法問題:

javascript 語法問題:

asc ann try style this tel broadcast all com

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 語法問題: