I have created a sample jsf application, and am trying to use jquery. In what directory should the jquery.js file be located? web-inf? src? I downloaded the .js file, but it does not seem to be working. I'm not sure where it should be.
I have updated my code to point to the googleapis, but it still does not work:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">
$(document).ready(function(){
$("#p1").mouseenter(function(){
alert("You entered p1!");
});
});
</script>
<p id="p1">Enter this paragraph.</p>
</h:body>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…