私はJQueryを初めて使用していて、eclipseを使用して動的Webアプリケーションを開発しました。私はJQueryをダウンロードし、そのフォルダをwebcontentの下に置き、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 ")の最後に括弧が必要です。hide()'? – mherzig
これは、https://api.jquery.com/hide/が*想定していることではありませんか? – nitind
が正しいが、少なくともアラートが働いたはずである。 – liz