Вопрос

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?

Это было полезно?

Решение

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

Другие советы

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

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).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top