Francesco
Francesco

Reputation: 25239

javascript: store data in a file or db without php?

i have to build an webapp, a simple survey with 5 answers, and i want to store the users choices (so to give the results) but i'm not allowed to use mysql or php... is it possible to use just jquery/javascript?

Upvotes: 2

Views: 819

Answers (4)

Chris Baker
Chris Baker

Reputation: 50592

When you say "store the answers", in what way? You want to store them for retrieval later by a third party? If so, you need some type of external storage, whether it is self-hosted database (mysql) with a server-side interface to store it (php), or a third-party solution that does the same thing for you.

Javascript itself is client-side. This means that, in the absence of supporting technologies, javascript is like Las Vegas: what happens on the client computer stays on the client computer. You can use javascript to store data locally via element storage or cookies, but in order to retrieve this data later, you'll have to use some other technology.

Upvotes: 4

xkonnectDeveloper
xkonnectDeveloper

Reputation: 131

This was posted previously by ja: Yes it is possible.

The technique is described below

http://jquery.tiddlywiki.org/twFile.html

Upvotes: -1

troelskn
troelskn

Reputation: 117457

As long as you only need the data to be available to the individual user, you have several options. The simplest is to use cookies, but with html5 there are some more powerful options available.

Upvotes: 1

Leopd
Leopd

Reputation: 42737

You could record the answers to Google Analytics as conversion events.

Upvotes: 3

Related Questions