I have a referring URL with a bunch of query string parameters. Here's my code so far:
var refURL=document.referrer;
var stock=refURL.substring(refURL.indexOf('?')+7, refURL.length);
This worked fine when I only had 1 query string parameter at the end of my URL. Now I have 3. I'd like to replace the second line so that the substring stops at the next "&".
var stock=refURL.substring(refURL.indexOf('?')+7, ????);
From there, I'd like to have another line that captures the next parameter and stores it as a variable. I can't use indexOf for that though, so how do I start from the "&" where I left off?
Thanks!