How to get a tracking url using javascript?


This question already has an answer here:

  • JavaScript query string [closed] 15 answers

I have a url


I want to get string use javascript


Thank guys.

If this isn't the location of the page, you may use

var str = url.match(/\?.*$/)[0];

If this url is the current one of your page, use

var str =;