try the below code, it will help you get the GET parameters from url .
for more details.
var url_string = window.location.href; // www.test.com?filename=test
var url = new URL(url_string);
var paramValue = url.searchParams.get("filename");
alert(paramValue)
A map-reduce solution:
Usage:
If you already use jquery there is a jquery plugin that handles this:
http://plugins.jquery.com/project/query-object
You can parse the URL of the current page to obtain the GET parameters. The URL can be found by using
location.href
.All data is available under
you have to parse the string, eg.
just call the function with GET variable name as parameter, eg.
this function will return the variables value or undefined if variable has no value or doesn't exist
try the below code, it will help you get the GET parameters from url . for more details.