There's not really a 'recommended way' to generate a UUID with jQuery;
that's not what it's about. If you want an actual UUID that conforms*
to the standard (8-4-4-4-12) then you can use this:
http://af-design.com/services/javascript/uuid/uuid.js

*given the limitations of JavaScript

On Mar 5, 11:11 pm, Klaus Hartl <klaus.ha...@googlemail.com> wrote:
> I've been using the data method for this, you need to pass a DOM
> element though:
>
> var uuid = $.data(el);
>
> --Klaus
>
> On 6 Mrz., 03:48, Mike Alsup <mal...@gmail.com> wrote:
>
> > >       What do you recommend to generate UUID with jQuery ?
>
> > >       Thank you !
>
> > I've been using something like this:
>
> > function uid() {
> >     var result='';
> >     for(var i=0; i<32; i++)
> >         result += Math.floor(Math.random()*16).toString(16).toUpperCase
> > ();
> >     return result
>
> > }

Reply via email to