This is the code to my XHTML page. jQuery is in the /js/ folder in my application. All other pages' validation is done with jQuery using the same file, but I cannot run a simple jQuery code on this test page that I've created. This is the code of the page:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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 type="text/javascript" src="js/jquery.js"></script>
<script>
$(document).ready(function () {
$("p").text("The DOM is now loaded and can be manipulated.");
});
</script>
<br/><br/><br/>
<p>Not loaded yet.</p>
<input id="pedram" type="text" onclick="alert('hi');"/>
</h:body>
</html>
I have also tried to use CDATA tag. I have also moved the script to the head of the document.
The only thing that works correctly is the alert() that I've put inside the onclick event. Nothing else works.
Please tell me what am I doing wrong.