This jsp works:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"> </script>
<script type="text/javascript" src="jqReady.js"> </script>
</head>
<body>
<div id="hello">Empty</div>
</body>
</html>
this jspx does not work:
<?xml version="1.0" encoding="utf-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"><!-- required for FF3 and Opera --><jsp:text> </jsp:text></script>
<script type="text/javascript" src="jqReady.js"><!-- required for FF3 and Opera --><jsp:text> </jsp:text></script>
</head>
<body>
<div id="hello">Empty</div>
</body>
</html>
</jsp:root>
Both use the same jqReady.js
:
$(document).ready(function() {
$("#hello").text("Hello, world " + new Date());
$("body").css("background-color", "grey");
});
In case of jspx the function passed to ready()
is not called.
Using Firebug I have observed that $.isReady
I am using Iceweasel 3.5.16 (like Firefox 3.5.15), JBoss 7.1.1
Related questions/answers (I have already applied those recommendations):