Qキーを押す度にjsonファイルに「count : 1」「count : 2」...
と書き込んでいく機能を実現したいです。
下記コードだと「POST http://localhost:3000/mod/js/status.json 404 (Not Found)」
と出てしまいます。
.postでは実現できないのでしょうか?場合によってはajax通信も考えています。
common.js↓
js
1jQuery(function($) { 2 if (e.keyCode == 81) { 3 $.post("status.json", { t1:1}, function(data, status, xhr) { 4 if (status == "success") { 5 console.log("success!") 6 } 7 }); 8 } 9});
このcommon.jsとstatus.jsonは同じ階層に置いてあります。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。