[jQuery] Text append / replace not working in ffx 2.x and HtmlUnit
Hi,
Forgive me as I'm a total jQuery n00b. However, I am rather confused.
I have the following trivial code:
<html>
<head>
<script src="jquery-1.3.1.min.js" type="text/javascript"/>
<script type="text/javascript">
$(document).ready(function () {
$("p").text("The DOM is now loaded and can be manipulated.");
});
</script>
</head>
<body>
</body>
</html>
This is effectively lifted from the ready() documentation page
http://docs.jquery.com/Events/ready#fn
This code works fine in Safari 3 on my machine. It does not work at
all in Firefox 2.x on the same machine. However... the documentation
page -does- do the substitution fine.
More importantly, the firefox problem is just a distraction because I
find the same behaviour (text replacement not working) when I run
HtmlUnit (2.5 snapshot) tests in Java with the same HTML above.
The fact it fails in both ffx 2.x, a reasonably "well established"
browser, and in HtmlUnit gives me some cause for concern that there is
some kind of bug here.
Can anybody tell me what I'm doing wrong, or give clues as to why this
would be broken in Firefox 2.x and HtmlUnit?
For what its worth .append does not work either - that's where I
started.
Puzzled as to why the jQuery doc page for ready() works in firefox
though. Perhaps this is related to (slower) page load times eg a race
condition?