html

  • function
2.0.4
 

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

live.html(el, compute, parentNode, nodeList) 2.0.4

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

Parameters

  1. el {HTMLElement}

    An html element to replace with the live-section.

  2. compute {can.compute(getterSetter, context)}

    A can.compute whose value is HTML.

  3. parentNode {HTMLElement}Optional

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

    Use

    can.view.live.html is used to setup incremental live-binding.

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