Javascript attributes disappear when going back

This question is mostly about javascript and cookies but
since I use CF i decided to post here.
I have a very simple question - I hope!
I have the following code in my very simple page:
When I click on the link "turn black", the layer "newdiv"
turns black. Now if I click on the google link go to google and hit
the back button to come back to my page, the layer "newdiv" retains
its original background color of gray.
I want the color to remain black when I hit the back button.
It works fine on Mozilla and Netscape, but does not work on IE6.
How can I make it work on IE ? Any pointers much
appreciated.

Hi sanman,
You need to drop a Javascript cookie when the user clicks on
the "change background link". You'll set that cookie to
bgcolor="black" or someithing and tell it to expire when the
browser closes. When the page first loads, ask if the cookie
exists. If it doesn't, put the default gray color. If it does, set
the bgcolor of the div to the value of the cookie. This way, no
matter where the user goes after they leave this page, when they
come back, the div will be the color that they chose. It will even
work if the user clicks on "back".
I don't know the code by heart because it's been awhile since
I've used it, but if you Google Javascript cookies, you can find a
bunch of tutorials on how to set and delete JS cookies.
Peter

Similar Messages

  • App crashing when going back to previous view

    I've got my app. which has several views. in my 3rd view, i have a list of questions with yes/no answers the answers to which I'm saving to a plist. it was working all good. but then i added a first view with a table which has 4 options, clicking on either of these rows go to the same view but each of them change the value of the variable in my singleton class, which then decides which questions are added to the 3rd view. so this helps me to jus have one view but the variable controls the different questions. Now my problem is that if i change something in my 3rd view, for eg, i choose yes/no , then when i am going back to the main viw , my app crashes. I am not sure why this happens.How does it work anyway-the inherent back button on the navigation bar? im guessing it calls the viewdidload function for the first/second view when going back to them from the first view, i dont undrstand why it crashes, coz the viewdidloads of these views seem okay to me.
    thanks

    write the piece of code causing the crash or paste the output on the console to get to know what actually cause your application to be crashed.

  • Workflow status web part gives error when going back to previous stage (using GO TO) in Project Server 2013 workflow

    Hi,
    Workflow status web part gives error when going back to previous stage (using GO TO) transition activity  in Project Server 2013 workflow.
    Please guide how to create a workflow which restarts from a desired stage.

    Thanks for your prompt reply....
    It gives following error
    Workflow Status
    This Web Part was unable to load.
    Information that may be useful in solving this problem was written to the Unified Logging Service (ULS) log on the Project Web App with the following ID: e95a9c9c-1f68-90d7-0a3e-5951df70fec6
    For more information, contact your Project Web App administrator.
    what do you mean to restart the Project Server 2013 with different project name, please elaborate....

  • HT202159 When downloading os x lion, i got an error message, when going back into purchased items in app store to resume, i found i had no resume button. what can i do?

    .

    When downloading os x lion, i got an error message, when going back into purchased items in app store to resume, i found i had no resume button. what can i do?

  • X200s sometimes hangs/freezes when goes back from sleep

    There is a confirmed bug in ubuntu jaunty/karmic running on lenovo x200 series notebooks. Shortly, it sometimes hangs/freezes when goes back from sleep mode.
    https://bugs.launchpad.net/ubuntu/+source/linux/+bug/479842
    Does anyone know anything  about it? How do i contact lenovo engeneer about it?
    Here is filled bug report in ubuntu bugtracker: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/479842

    There is a confirmed bug in ubuntu jaunty/karmic running on lenovo x200 series notebooks. Shortly, it sometimes hangs/freezes when goes back from sleep mode.
    https://bugs.launchpad.net/ubuntu/+source/linux/+bug/479842
    Does anyone know anything  about it? How do i contact lenovo engeneer about it?
    Here is filled bug report in ubuntu bugtracker: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/479842

  • Why does safari reload page from beginning when going back in history

    This behavior in safari is driving me nuts, i'm using mountain lion 10.8.1 and everytime i swipe two fingers to the left after having left a page to checksomething, safari goes back to the page and starts me in a different place (usually very beginning) than where i was when i navigated away from the page.  i mean what the ****? this gets very infuriating pretty quickly, especially on really long pages that i now have to navigate to the same section i was when i navigated away from the page.
    example, i was reading about the samsung apple verdict on cnet, and i was reading i dont know, the 30th or so comment in:
    http://news.cnet.com/8301-13579_3-57500273-37/apple-v-samsung-the-infringing-dev ice-scorecard/
    I then navigated away from the page to look for a tangent the comments made me think of, and when i swiped two fingers to the left, low and behold, i am now at the top of the page and have to figure out what comment i was up to.. what.. the.. heck man?? am i doing something wrong? is there a way to 'fix' this behavior?
    I remember on snow leopard i could go back and forth between pages w/o the page having to reload/leave me at the top..
    another example is newegg.com, i was looking at monitors and playing with the differnet choices when clicking 'more choices':
    http://www.newegg.com/Store/SubCategory.aspx?SubCategory=20&name=LCD-Monitors
    scroll down to where it says options on the left pane, the page displays drop downs, i select a few, click on Search, and when i two-finger swipe to the left to get back, the drop downs are now gone!! that was the "last state" of the page, so why does the page have to get entirely reloaded?? It SHOULD still be in my cache and viewable in the exact same way as when i left the page..
    someone please help!

    Jesus H Christ this is still driving me up the wall, i can't believe everyone is just accepting this.  Isn't there a way to fix this?  Can we at least have an option to turn this OFF?? Reloading a page everytime i go back is such a waste of time/bandwidth/my nerves when i am in the middle of a page

  • Long waiting times when going back to the organizer after doing changes of images. Elements 11.

    After doing changes of images and going back to the organizer I have to wait a long time. This was not the case when I used elements 9. I have a lot of images stored around 18000. There are also often long waiting times when I move around in the organizer. Any suggestion?
    Bo Augustsson

    Please see blog: http://psekb.blogspot.in/2013/04/how-to-improve-pses-performance-please.html
    Please let me know if that doesn't helps.
    ~Andromeda

  • There is a dead area in the center of the display.  Display is normal on both sides.  Cursor will cross it but disappears when going through it.  Has anyone seen this?

    I have a dead area in the center of the display in the form of a vertical line about 1/2 inch wide.  The cursor disappears when passing through it but is visible on both sides.  Display is normal on both sides.  Anyone seen this before?

    Might want  to run the Apple Hardware Test just in case.
    Intel-based Macs: Using Apple Hardware Test

  • When going back and Click many slide Unanswered questions on Quiz are not counted correctly

    Hi,
    I'm using Captivate 8, and made a simple multiple choice quiz, with an option "submit all button".
    It works correct, except for when using the back button,and when i clicking many slides in right side navigation.
    When trying to submit, I get the following message:
    "One or more questions is incomplete. Answer all questions to continue."
    the problem occurs with publications in HTML5, the SWF Flash version all goes well.
    Someone would have an solution, thank you
    Bourre

    Primarily I was responding to, "The workaround is to re-click each answer that is navigated. In short, before clicking Next always click an answer even if it looks 'clicked'." Of course it would be a difficult work around. A very confusing scenario for the learners. I thought ACGITech's second solution was much better.  That was to change the preferences so that the button was a submit button instead of "Submit All".
    Lillybiri, I understand where you are coming from regarding the messages. My ears pricked up as soon as I realised you had concerns over my response. I respect your opinions and most definitely my comment was confusing for anyone to read. Thank you for the opportunity to explain what I had in mind.
    Regarding the messages I was really just thinking that if the messages were not needed they can be turned off on each slide. An instructor/ designer may want to turn off messages in a summative task where feedback is often not wanted until after they have finished. At this point the learner can review the quiz.
    In the case of formative assessments then you would definitely want the messages.
    I really should have said this. The way I said it was very unclear.

  • How to force focus last focused HTML input element when going back in history with backspace?

    SUMMARY: I am a Firefox user with HTML knowledge. I want to be able to configure Firefox to behave in a special manner when I hit backspace. It's something that Firefox already does, BUT NOT ALWAYS. I don't know why it behaves differently in different situations for no apparent reason. I want to be able to configure firefox to ALWAYS behave in the manner I want to. Read below for the precise description.
    When I fill a FORM in a page, wether POST or GET, and press ENTER, it obviously acts as expected: submits the data and brings me to a new page. When I get to the new page, and I press BACKSPACE, Firefox behaves in sometimes like TYPE 1 and sometimes like TYPE 2 (see below), and I can't predict which one he will choose. I want to be able to configure it to behave ALWAYS like TYPE 2.
    TYPE 1 - Firefox reloads the previous page, as if I just entered it for the first time.
    TYPE 2 - Firefox brings me back to the exact same page view I had before pressing ENTER to submit the FORM.
    2.1 - It doesn't reload the page;
    2.2 - It places the page in the same scrolled position I was before (for example, if I scrolled to the bottom of the page to fill the FORM and press enter, after pressing backspace it brings me to the bottom of the page again;
    2.3 - It automatically focus the HTML input element I last typed (the element that was focused at the very moment I pressed ENTER to submit the FORM).
    So, I want to be able to configure Firefox for it to ALWAYS BEHAVE LIKE TYPE 2 whenever I fill a HTML FORM, press ENTER and press backspace after going to the new page. All three details I gave are important. Remember that I've already experienced TYPE 2 in previous versions of Firefox, I just wish to FORCE IT to behave like that ALWAYS (because for no apparent reason, sometimes it behaves like TYPE 1 instead).
    Please let me know if that's possible, and if not, I would really THANK YOU ALL FOREVER if you add this feature to the next version.

    It's set to true.
    I saw the add on you suggested, but it does not fulfill my needs.
    I like the behavior exactly as I said because, after submitting the form, I want to be able to look something in the new page and quickly get back to the form, change the text I wrote in the input element and submit it again, in a matter of one or two seconds only...
    I was able to do that whenever firefox behaved like TYPE 2 (explained above)...
    Thanks for the reply but didn't solve my problem yet...

  • IE8 - Underline and color disappear when clicking back arrow on links or colors incorrect

    I understand my heading may sound confusing.  I have an issue which I  cant seem to figure out with the help of a friend as well.
    1)  I have to clear out the cashe or select "delete browsing history" and  then refresh to get the page to look right (the links to be blue with an  underline underneath the word) - it shows up Black.
    2)   When I refresh the page and colors are correct, I click on the link  such as on the "PRINT" page on the word "HERE" it goes to the next  page.  Then I click the back arrow and now the word is black and the  underline is missing?  It is suppose to return to the same color (blue)  with an underline underneath the word.
    The same issue  is when you click on:  "Portfolio" then go to "Web" then click on the  second webpage on the slider - images (VYTEK website).  I am having the same problems with the  links ("NEXT WEBPAGE", "PREVIOUS WEBPAGE" and the "HERE").  It looks  fine at first, click on the link and click the back arrow, now the links  are black and the underline is gone?
    I have included  the link below.  If you view in Firefox, you will see the correct pages  not problem.  But look at it in IE8 and you will see my dilemmia.
    http://jourisdictiondesigns.com/print3.html
    http://jourisdictiondesigns.com/web3.html
    I have also included a IE8 CSS page to fix the issues, but nothing seems to work.  I have included the link to the IE8.css page.
    IE8 CSS PAGE LINK:  http://jourisdictiondesigns.com/css/ie8.css
    VYTEK_WEBSITE.CSS LINK:  http://jourisdictiondesigns.com/css/vytek_website.css
    VYTEK_WEBSITE.HTML LINK:  http://jourisdictiondesigns.com/vytek_website.html

    CSS Pseudo Classes (link states).  There are 6 links states.
    a (rules for all links)
    a:link (unvisted link)
    a:visited (visited link)
    a:hover (on mouse over)
    a:active (on click)
    a:focus (on tab key or on click in IE)
    If you define a rule for a:visited, you'll get better results when you hit the browser's back button.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How can I close a file when going back to my master presentation?

    I have about 20 large presentations with mixed video and images that are controlled from a master presentation. When I run a presentation and then go back to the master the presentation, the one I just showed remains open. These are really big and I don't want them to be open unless I'm showing them. Everything is running fine but I don't want a glitch in the middle of the presentations because I run out of memory or even virtual memory.
    Any of you figured out how to close a presentation when you hyperlink back to the master file?
    Thanks - Larry

    Check with Apple support. Had to go to the expert to get the answer. If you use the hyperlink to open up different Keynote files and return to the main menu file it will leave the other presentation open. So if you have presentations using QT video it will run out of VM based on the disk space you have.
    Weird....

  • Unanswered questions on Quiz are not counted correctly when going back

    Hi,
    I'm using Captivate 8, and made a simple multiple choice quiz, with a "submit all" option.
    It works fine, except for when using the back button.
    When trying to submit, I get the following message:
    "One or more questions is incomplete. Answer all questions to continue."
    It seems that questions that are revisited keep the previous answer, but are marked as unanswered.
    Thanks,
    Yuvalal

    ok... so re-reading your original question I see the reason... the back button seems to screw things up.

  • Safari. When going back on a web page, why does that page start at top?

    Hi, new to Apple and macbooks etc, but bought a new Macbook Pro and very happy I am with it too.
    However, one thing with Safari bothers me. When I am on eBay for instance and have scrolled halfway down a page, I then click a link that takes me to whatever, within the same tab. When I then want to return to the previous page, at the same point that i left it, i.e halfway down the page, when I do this it always opens at the top of the page and I have to scroll down again and find the place I was before.
    Hope this makes sense and someone can answer why this happens or offer a solution to stop it from happening. (pretty sure it doesn't happen in firefox but I don't really use that now.)
    Oh, mountain lion 10.8.3 and safari 6.0.3

    Do you mean opening a link to one of your pages or opening an external link?
    Can you go back properly if you open the tab history via the right-click context menu or by holding down the left mouse button on the Back button?
    You may need to reload your web page(s) and bypass the cache if you've made changes to files.
    *Press and hold Shift and left-click the Reload button.
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Cmd + Shift + R" (MAC)

  • Safari freezes when going "back" via mouse wipe

    Hi,
    have a problem with my mac mini and OS X 10.9.
    When I want to go back to a last visited page by wiping on the mouse to the left, the safari tag freezes. Any ideas?
    Thanks,
    Bernd.

    Hello fakewoodforest,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    Safari: Unsupported third-party add-ons may cause Safari to unexpectedly quit or have performance issues
    http://support.apple.com/kb/ts3230
    Best of luck,
    Mario

Maybe you are looking for

  • [SOLVED] Bash coloured prompt issues

    Hi, I'm having trouble with my bash prompt and after going through a sea of posts on prompts I can't seem to figure out why mine isn't giving the desired behaviour. YELLOW='\[\e[0;33m' WHITEBOLD='\[\e[1;37m' WHITE='\[\e[0;37m' ORANGE='\[\e[1;31m' PS1

  • Trouble building an installer with NI-DAQmx and tasks

    I am having trouble getting an installer that includes my tasks for NI-DAQmx.  I select the configuration wizard from the hardware tab, it shows my tasks with checkboxes but i cannot 'check' the task I want, it says "the item cannot be checked becaus

  • Combining data files

    Hi, I tooks data from hardware and saved it as a series of small files so I would not be stuck with huge files. Now I want to put together some of these files. I have the files as data_001.lvm, data_002.lvm, data_003.lvm etc. I have tried using the m

  • Can we link all the documents for a particular requirements document

    Hi,         As of now, In Solution Manager we can able to find the document only if we know the document name or any of other details. Can we do in such a manner, If we have requirements document and can we link all related documents (Functional Spec

  • .EML formatted documents in Spotlight

    I run MSOffice for Mac 2011 v 14.2.2.  When i save emails, i drag them into the appropriate DropBox folder, and it saves them as *.EML  Finder used to be able to search for words within the EML documents saved on the disc, but when I installed Lion,