I have a url as string in javascript like follows :
I want to filter the string and get
?param=1¶m=2....
How can I do this in javascript?
I have a url as string in javascript like follows :
I want to filter the string and get
?param=1¶m=2....
How can I do this in javascript?
var str= "http://localhost:8080/Blah.ff?param=1¶m=2";
var str2 = str.substr(str.indexOf("?"), str.length);
alert(str2);
var urlstring = "http://localhost:8080/Blah.ff?param=1¶m=2";
var querystring = '?' + urlstring.split('?')[1];
There are a lot of ways to do this. I would start with the window.location or location.href elements. Read up some more here: