私はpugテンプレートファイルでAjaxリクエストを送信したいと思います。pugテンプレートでAjaxリクエストを送信するには?
form#payment-form()
section
label(for="amount")
input#amount(name="amount" type="tel" min="1" placeholder="Amount" value="10")
script(src="scripts/jquery.js")
script.
(function() {
var amount = $('#amount').val();
$.ajax({
type: "POST",
url: "/posturl",
data: {'amount':amount},
success: function(){},
dataType: 'json'
});
})()
しかし、それはどのように動作しませんか? は私が