ajax(Function callback[, Object ajaxOptions])

Release 1.1 - ...

ajax(Function callback[, Object ajaxOptions])

Used to start an Ajax callback to the server-side counterpart of the Smartlet. It is an asynchronous method that works with a callback function pointer that will be called when the roundtrip is completed.

Usage:

Javascript CopyCode image Copy Code
var smartlet = $j.scf.smartlet.get(el);
smartlet.set("data", $j("#txtData").val());
smartlet.ajax(function(){
   var s = smartlet.get('status');
   $j("#statusDiv").html(s); 
});