Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Proper jQuery plugin #29

eych opened this Issue Sep 16, 2011 · 1 comment


None yet
2 participants

eych commented Sep 16, 2011


I guess I have a pretty specific setup when the JS logic that I create loads externally into a 3rd party site (it is used to display a widget on a 3rd party site). I try not to use the global window.* namespace at all, because it is not mine in my case. I am also using jQuery which allows me to completely remove it from the global namespace and just keep a reference in my local variable ( with jQuery.noConflict(true) ).

Spinner by default always assigns itself to window.Spinner which is a problem for me. I've solved this so far just by passing "jQuery" instead of "window" to the main Spinner's anonymous function and thus make it add itself to jQuery.Spinner without messing much with the main Spinner's code.

This is almost fine, but I don't like that I can forget to do this change on the next Spinner update and thus break everything. If Spinner was available as a proper jQuery plugin (and thus only use the jQuery's own namespace) it would be a perfect solution.

Thanks for considering this! :)


fgnass commented Apr 2, 2013

Spin.js is now a UMD module and can be loaded with AMD or CommonJS loaders to keep the global namespace clean.

@fgnass fgnass closed this Apr 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment