I have a var that captures the referring URL:
$(document).ready(function() {
var referrer = document.referrer;
console.log(referrer);
});
Assuming the url is http://www.example.com/this/is/my/path
how can I set referrer
= /this/is/my/path
where the actual host domain may be variable? E.g. I want to use this on difference domains.
Update
This answer: jquery - get url path? does not help as it's a solution that uses location.pathname.split not the referrer, and also splits the path based on a string not capturing it completely.