質問

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