HTML/Javascript Q&A
- Started
- Last post
- 11 Responses
- majman
Ok, I'm providing the Q and hopefully somebody here will have an A or two for me:
On my site I have one of three random backgrounds that load in: http://www.majman.net
Now, when you click on the resume part, it launches a refreshes to the resume page, and again loads in a random background. Here's the question. How can I make sure that the same background is on when one clicks the resume page. I think it's just a variable that needs to be passed to the next page, but I have no clue how to do it. Any help would be wonderful.
Let me know if that doesn't make any sense. Or if i can answer anybody elses questions, don't hesitate to ask.Thanks,
- majman0
this is getting burried pretty quickly. i probably picked a bad night to ask this question.
- majman0
please please please please
please please please please
please please please please
please please please please
please please please please
please please please please(i hate it when the first two responese to my thread come from me)
- podLob0
there's 2 ways I can think of of the top of my head.
1. pass the variable through the location search string. I wouldn't use this method because the variable would be visible in the url.
2. use a cookie. The easiest way to pass small amounts of info from one page to another.
- auricom0
go with podlob, he's the shizzle. helped me before.
i don't know an answer to your question but just wanted to say nice site.
- majman0
hey, thanks auricom. yeah, podlob is the man. my site actually uses his php newsbox.
thanks podlob, looking into the cookie thing. can't find a good resource for how i might go about this though.
- clearblur0
use a cookie, and don't specify a date; that should make it per-session, so when a user comes back the next day, they get stuck with a new random background for that session.
sorry, don't have time to write up an example, but it's something like document.cookie = 'blah'
- podLob0
I not at home right now, or I would code it up for you. I do have a set of cookie functions available for download off my site. They're in a zip file full of a bunch other stuff.
- podLob0
once again, I can't spell correctly if it's after 10:00 pm
- majman0
awesome,
thanks again podlob.
i'll let you know how it goes.
- podLob0
Here's a zip file containing the code for a random background image where the image remains the same for each session.
- majman0
alright, it's all hooked up and seems to be working properly. thanks again for the scripts podlob.