
What you are about to see uses 'simple' javascript commands. The code on this page is fully cross-browser compliant (versions 4 and beyond). To see how it works, study the source code - later.
Passing data to another page
It would be nice to use the same page over and over again without a lot of different code. Passing data to that page and then interpreting it will do that.
Question
Just how can you get data from one page to another?
Answer
Using frames and simple javascript can accomplish data passing. But if you don't want to use frames, then one simple method - the basis for this demonstration - is to simply append the data you want to pass to the end of the next page's URL. Something like href='nextpage.htm?myname. Then some javascript on the 'next page' simply unscrambles that information for you using the location.search.substr(1).split("?") function to get everthing past the ? in the URL.
Click any small image to see a larger picture and some related text.
How does it all work? You can look at the source code and help yourself. There are enough comments in the source code to make it simple for you to adapt this code for your own pages.
|
Credits
|
|
Please leave the code credits alone. Sharing is what makes the Internet such a great experience, but always give credit where it is due.
If you found this site helpful, please take a moment and help someone less fortunate - click the Hunger Site link.
|

|
|