This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Output for View | |
$(document).ready(function(){ | |
$('#inv-1').load('/js/count.php',function(responce){ | |
$('#use-count').numerator( { | |
easing: 'linear', // アニメーションの動き | |
duration: 1000, // アニメーションの時間(ms) | |
toValue: responce, // どこまでカウントアップするか | |
delimiter: ',', // 3桁ごとに区切る値 | |
rounding: 0 // 小数点以下の桁数 | |
}); | |
}); | |
$('input[type="submit"]').click(function(e){ | |
var link = $('input[name="url"]').val(); | |
$.ajax({ // json読み込み開始 | |
type: 'GET', | |
url: 'https://xn--l8j.ml/index.php?url='+link+'&format=json', | |
dataType: 'json' | |
}) | |
.then( | |
function(json) { //jsonの読み込みに成功した時 | |
console.log('成功'); | |
//初期化 | |
$("#status").html(""); | |
$("#input").text(""); | |
$("#output").text(""); | |
//出力 | |
$("#status").html("<div class='notification is-success'><p>生成に成功しました。</p></div>"); | |
$("#input").text(link); | |
var t = json["url"]; | |
t = t.replace("https://xn--l8j.ml","https://あ.ml"); | |
$("#output").text(t); | |
}, | |
function() { //jsonの読み込みに失敗した時 | |
console.log('失敗'); | |
//初期化 | |
$("#status").html(""); | |
$("#input").text(""); | |
//出力 | |
$("#status").html("<div class='notification is-danger'><p>生成に失敗しました。</p></div>"); | |
$("#input").text(link); | |
} | |
); | |
}); | |
}); | |
$(document).ready(function(){ //カード削除ボタン | |
$(".delete1").on("click", function(){ | |
$(".card1").hide(); | |
}) | |
$(".delete2").on("click", function(){ | |
$(".card2").hide(); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment