The difference between the ${BuzzObjJS} built-in and the BuzzObj built-in can be subtle. BuzzObj is a reference to a JavaScript object. If you were to write it out using ${BuzzObj}, you would probably see something like “[object]”, depending on your browser. That’s because BuzzObj is just a pointer, it has no textual representation.
${BuzzObjJS}, on the other hand, is nothing but text. To be precise, it is a piece of JavaScript code that would evaluate to the BuzzObj. So evaluating ${BuzzObjJS} in JavaScript gives you BuzzObj. If you were to write ${BuzzObjJS} out, you would see something like “ng.buzz.buzzlet_123456”.
That’s probably a bit confusing still, so let me give you some guidelines. You should use BuzzObj anytime you’re directly calling a JavaScript function, for instance from within an {eval} block. ${BuzzObjJS} should be used when you’re trying to write out a bit of HTML that calls back to the BuzzObj.
See the following example taken from a widget’s HTML template:
{eval}
//Note we need to use BuzzObj here because this is pure JS
BuzzObj.tabHandler = new TabHandler(BuzzObj);
{/eval}
<a href=”#” onclick=”${BuzzObjJS}.tabHandler.nextTab()”>
Next Tab
</a>