Took me a while to figure out I had to wrap my jQuery in (function($){ ... })(jQuery), I think it would make sense to add this to the description for javascript on CPN.

Maybe change:

Custom Javascript for this node. Do not include

tags.
to:
Custom Javascript for this node. Do not include tags, if inserting jQuery wrap it with (function($){ ... })(jQuery).

Comments

damienmckenna’s picture

Title: (function($){ ... })(jQuery) in description » Give guidelines in the UI on how to properly insert JS code