Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Redirecting to a Splash Page but Only Once – Cookies

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27615
    BillyJoe
    Member

    Re: https://css-tricks.com/redirecting-to-a- … h-cookies/

    Hi Chris:

    Thanks for your cookie redirect code. I’m trying to implement it on my website, http://www.billyjoeconor.com .
    However, although the function works fully, too much time elapses before the redirection takes place, in which time the initial page (index.html) loads and displays about half way before the redirected page (welcome.html) appears.

    Would you please let me know what must be done in order that the redirection takes place sooner, before the initial home page (index.html) is able to load and partially display as it is doing now?

    Below is my configuration in the code as in the example shown on your website:

    Code:


    When the cookie is not found, I need the redirect to go to welocome.html. When the cookie is found I need the initial page index.html to continue loading and displaying.

    Thanks,

    Billy

    #69690
    Chris Coyier
    Keymaster

    Seems to me it taking that long because it needs to load jquery, load the cookie plugin, execute the code and all that, which page rendering doesn’t wait around for. If you wanted to to happen before any page loaded at all, you’d have to skip doing this with JavaScript and look into doing it with just PHP alone. Should be too touch, just research how to set and read cookies, and how to redirect a page with PHP.

    #69707
    BillyJoe
    Member

    Thanks for the info. I’ll look int it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.