Hi all, Got a question for you guys who're more knowledgeable than I am. I followed Mike Alsup's plugin development pattern at http://www.learningjquery.com/2007/10/a-plugin-development-pattern to create a plugin for a project I'm working on. It's a suggestion/ tooltip plugin, which although they've been written many times before, it was good experience in plugin-ifying my code so I can reuse it easily later.
However, my question is regarding the placement of some of the code; I have a block of code (the $(".suggestion") block) that I'm not sure of where it needs to be. It's honestly something that only needs to be called once to bind the event, but I don't want to have to place it by itself within a page; I want everything contained within the script for the plugin.. and just now thinking about it, could I place it above the (function ($) { closure? Since script tags mingle together once they're loaded on the page, I assume that would work. Any thoughts or suggestions here would be greatly appreciated. Here's a link to the plugin code: http://jsbin.com/aweso3/edit It's in the Javascript tab.. I've commented the area I'm curious about. Thanks! - T.J.