Saturday, November 22, 2014

Javascript - get unique number from time




To get unique number from time
   var d = new Date();
    var n = d.valueOf();
which will return
1416718344714
in MySQL, we need to set the data type as  BIGINT( 20 ).

In jQuery ajax post,  we can get the last insert number from autoincrement from retrun message.
But it is sometimes diffcult to syncronize this number to the div I want to update.
In some application, we had better  create a   unique number from time and force
the last insert number as this unique number in ajax post.

No comments:

Post a Comment