推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
real_newbie

Mustache.js中的Streaming是什么意思, 一般用在哪, 怎么用?

  •  
  •   real_newbie · Apr 28, 2011 · 6890 views
    This topic created in 5493 days ago, the information mentioned may be changed or developed.
    摘自: https://github.com/janl/mustache.js

    Streaming

    To stream template results out of mustache.js, you can pass an optional send() callback to the to_html() call:

    Mustache.to_html(template, view, partials, function(line) {
    print(line);
    });
    6 replies    1970-01-01 08:00:00 +08:00
    real_newbie
        1
    real_newbie  
    OP
       Apr 28, 2011
    新手求助的帖子不会显示在首页吗?

    所以我回复自己一下看看, 抱歉...
    Livid
        2
    Livid  
    MOD
    PRO
       Apr 28, 2011
    是的,/go/newbie 里的主题不会上首页。

    你的这个移动到 JS 节点。
    aligo
        3
    aligo  
       Apr 28, 2011
    就是流嘛,每输出一行会调用一次那个callback
    real_newbie
        4
    real_newbie  
    OP
       Apr 28, 2011
    @aligo,

    哦! 原来是这个意思, 非常感谢~ 豁然开朗~
    aligo
        5
    aligo  
       Apr 28, 2011
    @real_newbie 不客气
    这个东西对于前端使用不大,会导致dom树出错
    但是例如写入文件或者返回tcp,一样是流就有用了
    real_newbie
        6
    real_newbie  
    OP
       Apr 28, 2011
    @aligo,

    我就是用在server端, 来产生response用的.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5591 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 07:04 · PVG 15:04 · LAX 00:04 · JFK 03:04
    ♥ Do have faith in what you're doing.