Have you ever had a variable on a web page that you wanted to pass onto another page? Here’s how to do it.
On the page that has the required variables on it add the following code:
Where thenewpage.html is the page to transfer the variables to, Var1, Var2 are the names to give the transmitted variables (one or more) and firstVariable and secondVariable are the names of the original variables on the first page.
Add an onclick event to the image, button or link that will open the second page like: onclick=”openNewWithVariables()”
When the link is clicked the link to open the page will appear in the address bar something like: thenewpage.html?Var1=thevalue&Var2=thesecondvalue
On the Page that will be accepting the variables add this code to the <head> section:
And this just before the </head> tag of the page:
Not sure how to implement? Drop me a line and I will help as much as I can.