id([String elementId])

Release 1.1 - ...

Gets the id of the Smartlet, or (passing elementId) the actual id of an element in the Smartlet.
This method is symmetrical with the SXML smartlet.id() method on the server.

Javascript CopyCode image Copy Code
var id = sml.id();
var txt = sml.id('UserName');

Notes

The <smartlet>.ajax() method internally uses the jQuery native method jQuery.ajax(), which accepts a single argument, options. The SCF library internally creates an options object. This object holds a callback handler, an url and a contenttype. The ajaxOptions parameter you pass is merged internally with the object internally created before it is passed to the jQuery ajax() method.