11
rated 0 times
[
14]
[
3]
/ answers: 1 / hits: 30829
/ 12 Years ago, mon, july 2, 2012, 12:00:00
I am looking for a good technique to get away from what I am tempted to do: to set a global variable.
The first time someone runs a function by clicking a button it triggers an initial function to turn a few things into draggables. Later, if they click the button a second time I want to determine if the init
function has been initialized, and if so to not call it again. I could easily do this by setting a global variable from the init
function and then checking that variable from the click function, but I'm wondering how to do this without setting a global variable. I would really like an example of a way to do this.
More From » jquery