Global variable junk #69

Open
mourner opened this Issue Apr 4, 2012 · 2 comments

Comments

Projects
None yet
3 participants

mourner commented Apr 4, 2012

Supersized exposes two unnecessary global variables with very generic names: api and vars. Moreover, the api global variable is then used in the theme code to hook up to the plugin. This is a horribly bad practice (especially for a third-party plugin) and should be fixed (there should be only one entry point to the library - $.supersized).

For more information on why global variables in JS are evil, see this post: http://yuiblog.com/blog/2006/06/01/global-domination/

hylin commented May 15, 2012

Same as you.I use this in wordpress,global variables take some conflict with some plugins . So I have to change those global variables ,like api ,vars,theme..., into local variables . Supersized need to do some changes to be peace with other js lib code.

msach commented Nov 20, 2013

Posted two years ago, and not even a hint of a suggestion that this has been considered? Shame :(

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