Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
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.
Labels:
javascript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment