Posts Tagged ‘client side code

02
Dec
07

Autogenerate Id in Javascript

This is a little funtion for creating autogenerated Ids

//Declare some variables
var rand
var anotherNumber
var str
var myDate
var strDate
var text
rand= Math.random();
anotherNumber = rand + '';
str = anotherNumber.substr(2,4);
myDate = new Date();
strDate = myDate.getMonth() + '' + myDate.getDate() + '' + myDate.getYear();
text = 'yourResumedEntity'+ strDate + str;

Kind of simple, but worked




 

November 2009
M T W T F S S
« Mar    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Flickr Photos

il paese che muore

ascend.

Rain

Villa Moderna

31/365 : Futile

Untitled

the journey

What's that smell? Methane....Party Trick!

ha! there's still some flowers lurking about

Day Three Hundred Nineteen

More Photos

Leave your comment

Blog Stats

  • 117,156 hits