Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-06-2009, 06:58 AM   PM User | #1
xionhack
New to the CF scene

 
Join Date: Mar 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
xionhack is an unknown quantity at this point
Pass variable from one page to another

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!
xionhack is offline   Reply With Quote
Old 12-06-2009, 08:19 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:59 AM.


Advertisement
Log in to turn off these ads.