Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,602
    Thanks
    78
    Thanked 4,387 Times in 4,352 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •