Use JSON compatible arguments
renderJS methods should only use arguments which can be converted to JSON.
Otherwise, the values will be lost when a gadget is isolated inside an iframe.
Good example:
my_gadget.callGoodMethod(1, 'a', {b: 'c'}, [3, 4]);
Bad example:
my_gadget.callWrongMethod(function () {...}, document.querySelector('body'));