C
Citoyen du Monde
Trying to get some ideas on a simple javascript project (to teach myself the
language).
I want to develop a client-side vocabulary practice application that would
allow users to
enter their own words, their own definitions plus an example of how the word
is
used in practice. It'll be all client side with - cookies? to get
persistence so that the words won't
disappear on me each time the page is closed (which is what happened when I
used
just arrays with no cookies. .So, you can imagine (maybe) setting up 3
arrays as follows:
var word = new Array( );
var definition = new Array( );
var example = new Array( );
Then, using functions like:
addWord(); (or, newWord( ) )
addDefinition( );
addExample( );
nextWord( );
previousWord( );
In the HTML I want 3 input fields of some kind plus 3 buttons: "Previous
Word", "Next Word",
"New Word".
I was able to do this using arrays and hard-coding each new word, definition
and word-usage-example,into the
source, but then I thought of allowing the user to enter his/her own words,
definitions, examples.
This is where I started thinking of state maintenance and cookies. I'm
thinking of allowing input of,
say, 1,000 words at most.
Just wondering if cookies are the right way to go.
language).
I want to develop a client-side vocabulary practice application that would
allow users to
enter their own words, their own definitions plus an example of how the word
is
used in practice. It'll be all client side with - cookies? to get
persistence so that the words won't
disappear on me each time the page is closed (which is what happened when I
used
just arrays with no cookies. .So, you can imagine (maybe) setting up 3
arrays as follows:
var word = new Array( );
var definition = new Array( );
var example = new Array( );
Then, using functions like:
addWord(); (or, newWord( ) )
addDefinition( );
addExample( );
nextWord( );
previousWord( );
In the HTML I want 3 input fields of some kind plus 3 buttons: "Previous
Word", "Next Word",
"New Word".
I was able to do this using arrays and hard-coding each new word, definition
and word-usage-example,into the
source, but then I thought of allowing the user to enter his/her own words,
definitions, examples.
This is where I started thinking of state maintenance and cookies. I'm
thinking of allowing input of,
say, 1,000 words at most.
Just wondering if cookies are the right way to go.