JS - get the parameter from the URI
function getUriParam(name){
if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))
return decodeURIComponent(name[1]);
}
// usage -> url: http://localhost/index.html?id=1
var a = getUriParam('id');