I tried so many ways to get list item id but could not. Ofcourse i got one solution but it is not much proper solution. Can anyone give smart solution to get list item id by using js. I'm using sp 2010.
I tried this solution:
function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}
var itmID = getQuerystring('ID');
But it is not good way to get list item id,,.. Please help me to solve this. Thank you.