-4

There is a javascript variable that contains a list of numbers.
1) I want the user to be able to modify that list.
2) I want that list to stay preserved so that it can be shared between pages.

How can I do this?

Assumptions: There are no concurrent users.

Note: I dont want any code but just a textual description of what can be a way of implementing this ?

The Wanderer
  • 3,051
  • 6
  • 29
  • 53
  • 4
    This is way, *way* too broad for Stack Overflow. Start building something, and ask a specific, *answerable* question if you get stuck. – user229044 Jul 01 '14 at 05:26
  • @meagar I hope it is specific now? – The Wanderer Jul 01 '14 at 05:31
  • No, it's worse. You can't ask this question here. You're asking us to come up with the UI, the code, the back-end, literally *every part* of the solution. That's not was this site is for. You can't just post a list of **extremely** high-level requirements here and expect a coded solution. As it stands, my answer to the actual question you ask, "how can I do this", is "write a solution in software". – user229044 Jul 01 '14 at 05:31
  • @meagar I dont want the code or UI or anything but just a general textual description of what can be one of the ways of implementing it. – The Wanderer Jul 01 '14 at 05:33
  • Ok. "Use JavaScript. Persist the values somewhere". That is a completely appropriate answer for a question as broad and generic as this one. – user229044 Jul 01 '14 at 05:34

1 Answers1

0

Finally I figured out the solution to this : COOKIES. The more experienced web developers might say "So, what? Big deal??" but for novice users, for this problem you should consider using cookies. Cookies is what you use to store and share small values.

Refer to this wonderful tutorial on cookies: http://www.sitepoint.com/eat-those-cookies-with-jquery/ and a relevant SO post: jquery save json data object in cookie

To show Javascript Variable Value: Use the value as tooltip for a link element.
To modify Javascript Variable Value: Clicking on a link element can call javascript prompt, where the user can enter new values
To store Javascript Variable Value: Store the value in the cookie
To share among other pages: While storing the cookie use {path:"/"}

Also note that maximum size for cookie can be only 4kb. So, store your data wisely.

Community
  • 1
  • 1
The Wanderer
  • 3,051
  • 6
  • 29
  • 53