我是JQuery的新手,并开发了一个使用Eclipse的mavenized动态Web应用程序。我将JQuery降级并将该文件夹放在web内容下,并用src
标记引用它。JQuery不能在eclipse上工作
下面的代码片段:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript" src="/app/jquery-3.2.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
\t $("#hh").hide;
\t alert("OK");
\t
});
</script>
</head>
<body>
<input type="button" id="hh" value="here">
</body>
</html>
但是我没有看到服务器上的结果。
在$(“#hh”)结尾处需要parens。hide()'? – mherzig
是不是说https://api.jquery.com/hide/是*应该*发生? – nitind
这是正确的,但至少警报应该工作。 – liz