hi nico
thanks. it works fine but as sugested by job0107 with window.location.href.toString();
now if i need to fetch value that is not numeric,
like if i have url like
Code:
manage_products.php?choice=free
if i need to fetch value of choice that is "free" and its not numeric, then will this same function work or i need a different function for that.
vineet
Quote:
Originally Posted by Nico
Code:
var url = window.href.toString();
var id = url.match(/\?page=(\d+)/);
if (id[1])
{
alert('The ID is: ' + id[1]);
}
else
{
alert('No ID found');
}
... untested, but should work.
|