Tag: pug oboe.js

nodejs / express / oboe.js&pug:获取node()事件来更新dom

第一次使用节点和模板引擎(是的,我知道,可怕的地方“开始”,但不pipe)。 我从jsonstream构build一些内容,最后我想吐出这个内容到我的html页面的一个div,如下面这个( 更新 )expressjs片段: app.get('/foo', function (req, res) { //… get my stream called 'mystream' //… get ready to append content for items found in json stream var htmlbuf = ""; //now process the json stream: oboe(mystream) .node('{bar}', function(aBar){ //eventually, I'd like to actually append individual new DOM elements, //but for now I'll settle for […]