0

Is there a way to implement a simple Heart vote(just +1 vote with counter without ability to vote more than once) using only Javascript / jQuery and HTML5 data attributes, other HTML5 APIs, without any serverside stuff?

3 Answers3

2

You can use localStorage to record that client has voted. Something like this:

localStorage.setItem('voted', true);

To check if client voted before:

var voted = localStorage.get item('voted');

Update:

As you need a counter, you may try one of BAAS (backend-as-a-service) services, such as parse.com or kinvey.com

aadel
  • 884
  • 8
  • 15
  • 1
    That wouldn't work to show the total number of +1 votes because it would be stored locally on the clients. – Tjofras Aug 23 '13 at 21:04
0

No, there isn't. You need a server to store all the responses.

Grim...
  • 16,518
  • 7
  • 45
  • 61
0

You need to store it in some type of database. So if you don't have any server side code that does this you need to find a service that will do it for you. (I don't know if one exists but i wouldn't be surprised if there did).

Tjofras
  • 2,116
  • 12
  • 13