I have the following code which works awesome for getting the variables form the URL:
But it doesn't work if I use document.referrer instead of window.locationHTML Code:function $_GET(q,s) { s = (s) ? s : window.location.search; var re = new RegExp('&'+q+'=([^&]*)','i'); return (s=s.replace(/^\?/,'&').match(re)) ? s=s[1] : s=''; } document.getElementById(RefId).value = $_GET('refcode');
If I place window.location into a string and use the string in the function it works. If I place document.referrer in a string and use the string in the function it doesn't work.
The values of window.location is
The value of document.referrer isCode:http://site.org/Default.aspx?refcode=12345&pageId=890916Any thoughts?Code:http://site.org/bluepage.html?refcode=12345




Reply With Quote