Hi All.
I need to pass some variables from one page to another, using javascript. Basically, I have a main page, and a search page. On the main page, the user selects various search criteria, clicks search, and goes to the search page, which displays results, with selected criteria available for further changes.
Due to reasons I’d rather not go into, the search page itself uses an iframe, and search results are displayed by a server-side script in that iframe. So, this means I actually have to pass query parameters into an iframe on a subsequent page. Currently, I’m doing this through the location.search property, but because search page’s iframe defaults to a blank screen, as you change criteria and search again (without leaving the search page), it kinda “blinks”, which is annoying. I can have the search page open search results using a “target” attribute, but then my location URL won’t match the result set – since it doesn’t look like a default unchanging URL (it has a bunch of parameters appended from the front page), users will be tempted to copy/paste it, and the experience will be quite confusing and frustrating.
I hope that’s somewhat understandable. The questions that I have, based on above, are:
– Is there any way to pass variables from one page into the other, through javascript, without using location.search or a server-side script?– Can I modify location.href or location.search without actually causing the browser to reload the page? I can keep these in-sync with the page, but modifying these causes a reload and all of my state is gone.
I’ve considered having one page and hiding/showing layers, but would like to explore all other possibilities before trying that out.