CRM 2011 JS: Get Current record ID in CRM 2011

//This is how to Get Current record ID using javascript in CRM 2011.

 

//Get current record id

var Id = Xrm.Page.data.entity.getId();