Randy Jensen

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromRandy Jensen
ToMe
Subjecttrouble cookieing in ie6 and opera with the stylesheet switcher script
Date4 January 2007 15:04
Hello,

 First of all, thank you very much for all the great scripts you have
provided.

 I am trying to use your "stylesheet switcher" script and I am having a
little trouble getting it to cookie the users choice in IE6 and Opera 9.
Everything seems to be working in Firefox 2, IE7, Netscape 8 and
Safari.

 I'm not sure if this is the problem, but the site is designed in css
and the two column layouts are using a script to check the height of
both div's and then match them so the background fits to the length of
the content section. You can view the site at
[URL].

 Any help or direction is much appreciated. If there is anything else I
can provide, please let me know. Thanks again!

Randy J
FromMe
ToRandy Jensen
SubjectRe: trouble cookieing in ie6 and opera with the stylesheet switcher script
Date6 January 2007 18:14
Randy,

>  I am trying to use your "stylesheet switcher" script

I am guessing that you are not using any more, since I cannot see it on your
page. Let me know if you are still having problems.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromRandy Jensen
ToMe
SubjectRe: trouble cookieing in ie6 and opera with the stylesheet switcher script
Date8 January 2007 16:21
Hi Mark,

 Thanks a ton for answering my email, I apologize for not having the
page uploaded the way I described in my earlier email. I have been
testing a couple different scripts and I ended up uploading the wrong
files before I left. I have re-uploaded the pages I was talking about
and I really appreciate you taking the time to look at it. I have the
link below just in case you need it again. Thanks again and take care!

[URL]

Randy Jensen
FromMe
ToRandy Jensen
SubjectRe: trouble cookieing in ie6 and opera with the stylesheet switcher script
Date9 January 2007 14:23
Randy,

> I am having a
> little trouble getting it to cookie the users choice in IE6 and Opera 9.

Since you say you are testing IE 7, I assume you have IE 7 and the IE 6 zip
on the same machine. The cookie is stored using JavaScript. One of the
limitations of the IE zip packages is that they cannot store cookies using
JavaScript. It should work in a normal IE 6 install.

Now, for Opera; You are using this:
history.go(0);
immediately after changing the style. Opera does not fire onunload when you
reload the page (since you are not really unloading it, just reloading it).
As a result, the unload handler never runs, and the cookie does not get
saved. If the user clicks a link normally, it would work, except that your
reload happens first and breaks it.

I am not sure why you are reloading the page anyway - the script runs client
side and does not need to reload the page. If you still feel the need to
reload, you should store the settings first, immediately after changing the
style:
changeStyle('Default','Bigger Font');rememberStyle('mycookie', 10);


Tarquin
FromRandy Jensen
ToMe
SubjectRe: trouble cookieing in ie6 and opera with the stylesheet switcher script
Date9 January 2007 14:52
Hi Tarquin,

 I am running IE6 as an emulator and I just tested it on another
computer running only IE6 and you were right, it works just fine.
Thanks.

 The reason I am reloading the page is because of the way the script
that runs the matching columns command is handled in Firefox, Netscape
and Opera. The footer does not move down and the left nav script won't
re-run. That's why I had the page get cookied and then reload to
accommodate for the increased font size.

I've removed the reload function I had and you can see what happens
here:

[URL]

You may have a much easier way of doing this (or at least one that
doesn't seem so patch-worked together). Or these two scripts may just
not me destined to work together. Any suggestions? Thanks again

Randy
FromMe
ToRandy Jensen
SubjectRe: trouble cookieing in ie6 and opera with the stylesheet switcher script
Date9 January 2007 15:11
Randy,

> The reason I am reloading the page is because of the way the script
> that runs the matching columns command...

Ok, makes sense. So just make sure that you store the style preference
immediately after changing the style, and before reloading.

Note, however, that your column matching script uses the onload event, and
so does the stylesheet switcher. The first uses this:
window.onload=function(){
and the second uses this:
<body onload="
Only Opera treats them separately, which means that in most browsers, the
two should conflict with each other (so I am not entirely sure how this
manages to work in those browsers).

You should only ever have one onload handler. Remove the handler from the
body, and put its contents at the top of the other onload function instead.
FromRandy Jensen
ToMe
SubjectRe: trouble cookieing in ie6 and opera with the stylesheet switcher script
Date9 January 2007 16:42
Sounds good. Just wanted to send one last email thanking you for taking
the time to help me out. I really appreciate it. Hope you have a good
day. Thanks again!

Randy
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.