Is there a way to set GET or POST variables with javascript when the user leaves the page? If not, is there a way to change all links in the page to have GET variables attached? Or perhaps is there a way to change the links with a function when the user clicks them?
Sorry for my brevity, I have found how to get GET variables upon page load with javascript, but I failed to find this information, and could not find this question elsewhere on stackoverflow.
UPDATE:
What we want is that when the user goes to another page on the same website, if the GET variable "foo" is currently set, we want it to remain set on the next page. I've found how to check if the variable is set, but not how to set it again when the user goes elsewhere on the site.