Hive coding #4
How to vote?
by hive_coding
HTML
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@hiveio/hive-js/dist/hive.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
Author: <input id="author" value="freegifts"><br/>
Permlink: <input id="permlink" ><br/>
Voteweight: <input id="weight" > Between 1-10000 for upvote, Between -1 and -10000 for downvote, 0 remove vote<br/>
<button id="btnVote">Vote</button>
<script>
$("#btnVote").click(function() {
let author = $("#author").val();
let permlink = $("#permlink").val();
let weight = parseInt($("#weight").val());
hive.broadcast.vote('YourPrivatePostinkey---NeverAddYourKeyOnJSfiddleOrOtherWebsites', 'hive-coding', author, permlink, weight, function(err, result) {
console.log(err, result);
});
});
</script>
</body>
</html>