【发布时间】:2016-07-19 14:32:19
【问题描述】:
我不知道我的代码有什么问题。如果我的脚本在 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 包含到您的文件中
-
本地主机中是否包含jQuery?
-
我必须包含什么 jquery? @scrappedcola
-
@Eightleven 使用最新的:code.jquery.com/jquery.min.js
标签: javascript jquery html css localhost