Mod rewrite and javascript cookie

Discussion in 'Javascript' started by Stillpoint Media, Nov 22, 2011.

  1. First of all I confess, I do not know much about javascript. The
    problem is the following.

    I found a script to invoke a popup newsletter subscribe box using
    jquery. However the script only works when accessed by the direct URL,
    not via the SEO-friendly URL. So...

    This works:

    This doesn't:

    This is the javascript call. Thanks in advance!

    <script type="text/javascript">
    if (document.cookie.indexOf('visited=true') == -1) {
    var fifteenDays = 0;
    var expires = new Date((new Date()).valueOf() + fifteenDays);
    document.cookie = "visited=true;expires=" + expires.toUTCString();
    $.colorbox({width:"580px", inline:true, href:"#subscribe"});
    Stillpoint Media, Nov 22, 2011
    1. Advertisements

  2. Stillpoint Media

    Scott Sauyet Guest

    This seems unlikely to be a javascript issue, or even one with jQuery
    or your jQuery plug-in, as they really tend to know nothing about the
    content of a URL, just using them as a string of text.

    I don't see anything in there that launches a popup. It's possible
    that the $.colorbox call does so, but you don't supply it a url. How
    would it be able to distinguish between the two urls?

    -- Scott
    Scott Sauyet, Nov 22, 2011
    1. Advertisements

  3. Stillpoint Media

    beegee Guest

    You haven't included the code that shows the html anchor, #subscribe.
    Colorbox is indeed a popup ( actually a div ). Normally href itself
    would point to the url like href:"
    friendly". I'm not sure what the colorbox rules are for pointing to
    an anchor. Try pasting the URL into the href: value and see what

    beegee, Nov 23, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.