Javascript API


AJAX support

You can make blurts work with AJAX updates of your pages. Some of these functions can help you.


blurts.getToken( (selector|DOMObject|jQObject) )

Returns blurt's token, associated with specified textarea (or undefined, if blurt has not been recorded yet).
// returns token of recorder blurt associated with textarea with id "mytextarea"
blurts.getToken('#mytextarea');

blurts.cleanup( [(selector|DOMObject|jQObject)] )

Close all recorder players in specified context (without deleting blurts).
// close all recorder players
blurts.cleanup();
// close recorder players inside elements with class "comments"
blurts.cleanup('.comments');

blurts.cleanupByToken( token )

Close recorder player with specified blurt's token (without deleting blurts).
blurts.cleanupByToken('1abcde'); // close recorder player with '1abcde' blurt's token

blurts.windowLoaded()

This function should be called in case you inject widget after DOM parsed and/or window loaded.
/* function 'window.blurts_loaded' will be called automatically
   after blurts widget completely init */
window.blurts_loaded = function() {
  blurts.settings({ playerStyle: { "avatar":1 } });
  blurts.windowLoaded();
};
// inject blurts widget into page