...

View Full Version : Javascript/Cookie help needed *URGENT*



NYCSavage
11-15-2010, 12:02 AM
I need some help for University cousework that has been sent and I hope someone here can help.

I need to create a cookie (easy enough) and then populate that cookie with a word that is selected when you click a certain image.

Imagine you have image1.jpg and image2.jpg when a user selects image1.jpg the cookie needs to store image1 and load page2.html

If the user selects image2, then page2.html still needs to load but store the word image2 in the cookie.

On the next page, the cookie is loaded and the page needs to load the css file associated with that word

example:
image1 = firstcss.css
image2 = secondcss.css

Is this possible?

Thank you for all your help

Logic Ali
11-15-2010, 02:02 AM
Is this possible?Do you think somebody took the trouble to formulate that assignment without knowing that it could actually be done?
How far have you got and where are you stuck?

Philip M
11-15-2010, 09:16 AM
Please see Forum Rule 1.5. We will not do your coursework for you, but you are welcome to for assistance with specific Javascript problems.

NYCSavage
11-15-2010, 10:52 PM
Do you think somebody took the trouble to formulate that assignment without knowing that it could actually be done?
How far have you got and where are you stuck?

The assignment is to create a website that loads an external XML page and manipulates the data and then design the results with CSS. I wanted to go the extra step by adding a cookie that allows the user to change the CSS and for the changed CSS to work on every page.

I can create the cookie, but I don't know how to populate it by clicking on an image.

On the next page I can then find the cookie and read from it but don't know how to make it affect the CSS style chosen. I can use Javascript to change the CSS but don't know how to link the two of them.


Please see Forum Rule 1.5. We will not do your coursework for you, but you are welcome to for assistance with specific Javascript problems.

I understand this, and haven't asked for a complete solution, just an idea how to reach my goals. This isn't part of my coursework, it is just me going for extra points.

Old Pedant
11-15-2010, 11:08 PM
http://www.alistapart.com/articles/alternate/

More than you asked for. Probably more than you wanted to know.

p.s.: I found it by doing this:
http://www.lmgtfy.com/?q=specify+active+css+via+javascript

NYCSavage
11-16-2010, 12:06 AM
http://www.alistapart.com/articles/alternate/

More than you asked for. Probably more than you wanted to know.



That is amazing! Has everything I need.

Thank you so much, this should boost my percentage up a fair bit :)

ps: I did use Google but didnt know it was called active css :(

I did try searching or results like:

How to change CSS using javascript
and

How to change CSS using a cookie
lol



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum