Wednesday, February 26, 2014

get list item id in javascript?

You can use something like this



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 ccpid = getQuerystring('ID');





Artificial intelligence can never beat natural stupidity.


No comments:

Post a Comment