Given the following string/query string:
ajax/hovercard/hovercard.php?id=100000472545907&extragetparams=%7B%22hc_location%22%3A%22stream%22%7D
What is the best way to extract the id?
Given the following string/query string:
ajax/hovercard/hovercard.php?id=100000472545907&extragetparams=%7B%22hc_location%22%3A%22stream%22%7D
What is the best way to extract the id?
params = location.search.substring(location.search.indexOf('id')).split('&')[0]
id = params.substr(3)
If it is always shipped in this exact order - then
url.match(/\d+/)
otherwise
url.match(/id=(\d+)/)