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


Groups > comp.lang.javascript > #21480

Re: Variable issues and storing cookies

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Variable issues and storing cookies
Date 2013-10-01 07:01 +0200
Organization albasani.net
Message-ID <l2dkv9$dp6$1@news.albasani.net> (permalink)
References <e58dd859-2b9b-4a10-9e82-069004635056@googlegroups.com>

Show all headers | View raw


On 2013-10-01 05:04, k wrote:
> I was wondering, for my cookie clicker program, if it would be
> easier to use HTML Session storage or store cookies.

There's a difference between cookies (the kind you eat) and cookies (the
kind you store in your browser). Currently, your game only employs the
former kind. When you're ready for persistance (= you have some relevant
code), we can talk about cookies vs session storage.

> The main reason I made this post is the fact that I have an error in
> my code that has to do with variables and getting elements by Ids.
> The area with the problem is marked below with PROBLEM HERE.

This really doesn't have anything to do with browser cookies or session
storage. I don't have time to test and debug all of your code, but this
part looks dodgy:

> // grandma function PROBLEM HERE
> function five(){
[...]
>  pricefive + 2;
>  manyfive++;

The value of "pricefive" doesn't change in this statement.
Did you mean "pricefive += 2"?
Also, "manyfive" is not declared or initialized anywhere.

- stefan

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


Thread

Variable issues and storing cookies k <kalezwe@gmail.com> - 2013-09-30 20:04 -0700
  Re: Variable issues and storing cookies Stefan Weiss <krewecherl@gmail.com> - 2013-10-01 07:01 +0200
  Re: Variable issues and storing cookies JJ <duh@nah.meh> - 2013-10-01 17:40 +0700
  Re: Variable issues and storing cookies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-01 14:04 +0200
    Re: Variable issues and storing cookies John Harris <niam@jghnorth.org.uk.invalid> - 2013-10-02 14:55 +0100
      Re: Variable issues and storing cookies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-02 16:09 +0200
        Re: Variable issues and storing cookies John Harris <niam@jghnorth.org.uk.invalid> - 2013-10-03 15:00 +0100
          Re: Variable issues and storing cookies "ViLco" <villiber@tin.it> - 2013-10-03 16:17 +0200

csiph-web