...

View Full Version : Pass variable from one page to another



xionhack
12-06-2009, 07:58 AM
Hello. I am very new at using javascript and jquery.

Right now Im working on a website, and it has a hierarchical menu in the right and im also doing some content loading in a div, all that with javascript. My problem is that when they click on a link, I need to pass a variable "id" through the link. I dont want to pass it in the url, but I want to pass it in another way, for every link the id is going to be different. How can I pass a variable to another page and how can I retrieve it in that page so I can use it for the content loading? Thanks!

Old Pedant
12-06-2009, 09:19 AM
If you don't want it in the URL and you don't want to use server-side coding (ASP/JSP/PHP/CGI), then your only real choice is cookies. But of course users *can* disable cookies. If that's not a concern for you, then session cookies probably make sense. (Session cookies are just stored in memory on the user's computer, not on disk. So users can permit them even if they disallow permanent cookies...*IF* they are sophisticated enough to know the difference. Sad to say, 95% or more of users aren't that sophisticated.)

Why are you against doing it in the URL? You could encode it so that it doesn't *look* like an ID, you know.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum