get(String id/element/jQuery selector)

Release 1.3 - ...

Gets a Smartlet object by passing unique id, DOM element or jQuery object.

Passing in a jQuery selector object is possible since 1.2.

Usage:

Smartlets by convention mostly use a single outer DIV element that uses the unique Smartlet id. When a behavior is attached to this element, the clientside Smartlet object can easily be retrieved by simply passing a reference to it:

Javascript CopyCode image Copy Code
$j.scf.behavior.add(<name>, {
   attach: function(element, settings, jqueryObject){
     var smartlet = $j.scf.smartlet.get(element);
   }
);