"Richard Cornford" <Richard@litotes.demon.co.uk> wrote in message
news:bo4ebr$cqa$1$8300dec7@news.demon.co.uk...[color=blue]
> "Randell D." <you.can.email.me.at.randelld@yahoo.com> wrote in message
> news:kwhpb.263294$pl3.58800@pd7tw3no...
> <snip>[color=green]
> >function storeCookie(key,val) {
> > var age = 100*24*3600 * 1000; // ms in 100 days
> > storeCookieKey( key, val, age, true );
> >}//storeCookie
> >
> >
> >function storeCookie(key,val,age,reloadPg) {
> > var expDate = new Date();
> > var expTime = expDate.getTime() + age;
> > expDate.setTime( expTime );
> > document.cookie = key +"="+ val + "; expires="+[/color]
> expDate.toGMTString() ;[color=green]
> > if( reloadPg )
> > window.location.reload();
> >}//storeCookie[/color]
> <snip>
>
> It looks like a cut-and-paste mistake by the page author. From the
> parameter lists I would think that the second function was supposed to
> be called "storeCookieKey" but the author copied the first function,
> changed the body and the parameter list, but forgot to change the name
> as well. The error is not apparent because the second function
> definition replaces the first and the resulting storeCokie function is
> error free when called with the parameters intended for the first. On
> the other hand the function does not appear to ever be called by code on
> that page so neither should really be there. But then, there is so much
> JavaScript on that page that probably the whole lot should have been
> moved into an external JS file to cut down on the download, both by
> having it cached client side and for the users of non-JavaScript
> browsers who would not need it at all.
>
> Incidentally, as you admit to not knowing much about JavaScript, may I
> recommend that you not promote <URL:
http://javascript.internet.com >
> as, while they may make thousands of simple scripts available, there
> does not appear to be any informed vetting of those scripts and as far
> as I could tell none are good and most are extremely poor and not even
> close to a suitable standard for Internet use.
>
> Richard.
>
>[/color]
Thanks - With regards to the URL I had recommended in another post, I'll
take your comments that some/all of their scripts are "extremely poor" but
they have introduced me to Javascript, and helped me (and I'm sure others)
to take the effort and find out more on how to create their own code, as
opposed to borrowing from others on sites like the one I recommended.
Cheers
Randell D.