Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #8528

Re: Mod rewrite and javascript cookie

From Scott Sauyet <scott.sauyet@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Mod rewrite and javascript cookie
Date 2011-11-22 07:00 -0800
Organization http://groups.google.com
Message-ID <abcfef55-ec05-4bec-8425-bcb36a8de7ed@m7g2000vbc.googlegroups.com> (permalink)
References <08c68e5c-c1ce-4a13-92cf-82e05ba0737f@h42g2000yqd.googlegroups.com>

Show all headers | View raw


Stillpoint Media wrote:
> 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:http://www.example.com/test/php?id=1
>
> This doesn't:http://www.example.com/test/1/seo-friendly

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.


> This is the javascript call. Thanks in advance!
>
> <script type="text/javascript">
>   jQuery(document).ready(function(){
>         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"});
>                 }});
>
> </script>

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

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Mod rewrite and javascript cookie Stillpoint Media <tako@stillpoint-media.nl> - 2011-11-22 06:44 -0800
  Re: Mod rewrite and javascript cookie Scott Sauyet <scott.sauyet@gmail.com> - 2011-11-22 07:00 -0800
  Re: Mod rewrite and javascript cookie beegee <bgulian@gmail.com> - 2011-11-23 05:53 -0800

csiph-web