I have an URL with some parameters.
What is the easiest way to get the url parameter value giving only the end of the parameter string ?
Ex: http://my.domain.com/home?this_is_a_param=5
So, giving to the function :
function returnValueFromURL(url,"param"){
// What I need ...
// return 5;
}
Thanks.
I think i understand what you need:
1- get the query string (document.location.search)
2- split this string by ‘&’, and ‘=’
3- iterate over the array (split result) and just check if the string endsWith ‘a_param’
4- then use the function describe here: Parse query string in JavaScript to get the value