Forums

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

Home Forums JavaScript Javascript pop-up and Cookie not working in Google Chrome

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #43932
    tannercampbell
    Participant

    Here’s the pen: http://codepen.io/TannerCampbell/pen/jwIHn

    Alert box should pop up informing the user that tickets are sold out but should happen only once. The JS is working in Opera, FF, IE, and Safari but not in Chrome. I copy/pasted this script from a site online as I am not that familiar with cookies; did I mess something up? If yes, what? If no, does anyone have a better solution?

    Thanks,
    Tanner

    #130873
    CrocoDillon
    Participant

    In the script you have on codepen, you aren’t using the vars `page` and `windowprops` so you can leave them as they are or remove them.

    Anyway, it works for me, got the pop up once and the count increments every refresh. If you `alert(count);` right after

    function checkCount() {
    var count = GetCookie(‘count’);

    you can test that for yourself (but remove the non JS junk from top and bottom). It works for me on Chrome 26 by the way.

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