DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
    • can-simple-map
    • can-util
    • can-view-callbacks
    • can-view-live
      • can-view-live.attr
      • can-view-live.html
      • can-view-live.list
      • can-view-live.text
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-view-live
  • /
  • can-view-live.html
  • / On this page
    • can-view-live.html

      function

      Live binds a compute's value to a collection of elements.

      • source

      live.html(el, compute, [parentNode])

      live.html is used to setup incremental live-binding on a block of html.

      // a compute that change's it's list
      var greeting = compute(function(){
        return "Welcome <i>"+me.attr("name")+"</i>"
      });
      
      var placeholder = document.createTextNode(" ");
      $("#greeting").append(placeholder);
      
      live.html(placeholder, greeting);
      

      Parameters

      1. el {HTMLElement}:

        An html element to replace with the live-section.

      2. compute {can.compute}:

        A [can.compute] whose value is HTML.

      3. parentNode {HTMLElement}:

        An overwritable parentNode if el's parent is a documentFragment.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.