Created
September 9, 2014 14:35
-
-
Save patrickfox/7f6946c55e410d502d6b to your computer and use it in GitHub Desktop.
$.get_guid() generates a globally unique ID(GUID). The get_new flag returns a new id if true, or, by default, returns the previous id.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.get_guid = function(get_new) { | |
get_new = get_new || false; | |
if ($.guid === null) { | |
$.guid = 0; | |
} | |
if (get_new) { | |
$.guid++; | |
} | |
return $.guid; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment