A lot of my jQuery projects use sub menus. I'm a firm believer of using the hoverIntent plugin over jQuery's native hover()
, for usability reasons (and to prevent events being fired by accident by the user).
Because this plugin is used on every page of my site, and because it is only 8 lines minified, I just appended it to the end of my common.js
file, which is included on every page. I kept the author comments intact.
The advantage of this is one less HTTP request, for one. It is also common to every page, so it doesn't need to be cache controlled separately.
But, is this good practice? Am I being unethical to the original developer, by lumping his code right at the end?
Should all third party plugins live in their own JS file, and should I leave something like lumping it all together to an automatic minifiying/concatenating process?
Thanks.