0
我不知道我的代碼有什麼問題。如果我的腳本在jsfiddle中運行,那很好。但如果在我的電腦(本地主機)它不起作用。Myscript不在我的本地主機工作,但如果在jsfiddle這很好
這裏是我的jsfiddle:JSFIDDLE
這裏是我的腳本,我在我的電腦上運行
<html>
<body>
<input id="nominal" type="text" />
<script>
$(function() {
var money = 20000;
$("#nominal").on("change keyup", function() {
var input = $(this);
// remove possible existing message
if(input.next().is("form"))
input.next().remove();
// show message
if(input.val() > money)
input.after("<form method=\"post\" action=\"\"><input type=\"submit\" name=\"yes\" value=\"Yes\"><input type=\"submit\" name=\"no\" value=\"No\"></form>");
});
});
</script>
</body>
</html>
你需要將jquery包含到你的文件 – scrappedcola
jQuery是否包含在localhost中? –
我必須包含哪些jquery? @scrappedcola –