Hive coding #11
Hivejs: How to transfer Splinterland-Cards Part 2
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>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body>
<div class="row">
<div class="col-xs-8 offset-sm-1">
<div class="row">
<div class="col-sm-6">
Empfänger/recipient<input type="text" id="userto"><br/>
<button id="send">senden/send</button></div>
</div>
<h2>Ausgabe/Output:</h2>
<div id="log">
<table id="result" class="table table-striped table-hover"><tbody><tr><th>#</th>
<th>Card-Image</th><th>Card-Name</th><th>Card-ID</th></tbody></table>
</div>
</div>
</div>
<script>
var wif="NeverAddYourKeyonJSFiddle";
var requiredAuths= "mein-senf-dazu";
var cards=null;
var cardDetails=null;
var editions=["alpha","beta","promo","reward","untamed","dice","","chaos"]
//https://d36mxiodymuqjm.cloudfront.net/cards_by_level/alpha/Goblin%20Shaman_lv1.png
function loadCardDetail(){
$.ajax({
url: "https://api.splinterlands.io/cards/get_details",
type: 'GET',
dataType: 'json', // added data type
success: function(res) {
cardDetails=res;
loadCards();
},
error: function (request, status, error) {
alert(request.responseText);
}
});
}
function loadCards(){
$.ajax({
url: "https://api.splinterlands.io/cards/collection/mein-senf-dazu",
type: 'GET',
dataType: 'json', // added data type
success: function(res) {
...