Redirect question

this is a bit of a noob question but this is a real weird error I’m getting

After creating a cookie (JavaScript cookie) a function should then redirect the page to a different URL.

On both IE & Firefox the Cookie is being created so I know the functions being called properly. In IE the browser then redirects no problems, but on FireFox it doesn’t appear to redirect at all, just reload the same page.

I was using

document.location.href = newURL;

and like I say it didn’t seem to be working on FireFox so I changed it to

window.location = newURL;

and IE threw a major wobbly.

What should I be using to keep both browsers happy?

Well, I use many javascript redirects like that and I havent had a problem with IE or Firefox using document.location = newURL;

hth :beer:

yesterday I would have said I didn’t have a problem with this but it know works on my firefox but nobody elses…bit confused and annoyed actually cause I did test this all the way through development and now…

:frowning:

ok adding a zip file cause this is driving me nuts…

in the zip file are 4 html pages and 2 javascript files

in the html files there is one called comp.html
on this page is an accept terms link, the user needs to agree to terms before they can see the other files (index, second & third)

so if the user entered second.html in their browser they would be redirected to comp and asked to accept terms. once they did they would be redirected to the page they originally asked for which was second.html. what then stops second.html redirecting back to comp.html is the creation of a cookie when they accept terms

the problem is that in IE this works fine, but not in Firefox

In firefox the user clicks accept, the cookie is created and then instead of redirecting the user it seems to just reload the comp page

this is a real brain number, I need help :frowning:

** BUMP DIDDY BUMP BUMP **

again being bumped, no-one offer any help on this one

…even if you downloaded my zip file and it worked ok on your machine, please let me know anyway

:frowning:

sup rab. i downloaded the zip and like you said, it works in IE, but not FF. when I run in FF and click ‘Accept’ it is suppose to redirect me to comp.html. But I get an Error 404 saying that comp.html doesnt exist. Obviously it is in the same dir and it is there. Funny thing is that the URL Bar displays ‘http://localhost/cookies/null’ in FF, and IE shows ‘comp.html.’

Hope that helps some…:beer:

sorry no clearer :frowning:

kinda double posted but I’ve never done it before and I’m desperate right now :frowning:

http://www.kirupa.com/forum/showthread.php?t=213831