Results 1 to 8 of 8

Thread: redirect question

  1. #1

    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?
    now with blog, click here

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

    hth

  3. #3
    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....

    now with blog, click here

  4. #4
    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
    Attached Files Attached Files
    now with blog, click here

  5. #5
    ** BUMP DIDDY BUMP BUMP **
    now with blog, click here

  6. #6
    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

    now with blog, click here

  7. #7
    602
    posts
    Backend Specialist
    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...

  8. #8
    sorry no clearer

    kinda double posted but I've never done it before and I'm desperate right now

    http://www.kirupa.com/forum/showthread.php?t=213831
    now with blog, click here

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012