Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.4.15
-
Validated this bug on my dev environment: Windows 7 64 bit using Firefox 4.0beta10 and Chrome 8.
Description
This is adapted from a wicket users post I made (links are to the same thread in two archive systems):
The problem: I have a panel with this:
<wicket:head>
<script>
if (someVariable < 0)
</script>
</wicket:head>
This script fails to execute when the panel is loaded by ajax. If I replace the less than character "<" with equals "==", then it executes (but of course, this is not what I need).
I tested this in Firefox 4.0b10 and Chrome 8.
After some debugging, it seems to me that this needs to be corrected in wicket-ajax.js. The header contribution is sent to the browser inside of a CDATA section so the "<" character arrives to javascript intact. However, in parsing the script tag, the "<" seems to signal the beginning of an HTML tag that then is considered malformed.
Possible workarounds for apps:
- Invert the logic so a greater-than is used. In my example, this would be: "if (0 > someVariable) {"
- Put the code into a separate JS file (the downside is it requires another network hop from the browser)
- Embed the script in <wicket:panel> rather than <wicket:head> (the disadvantage is the script will be re-sent with the panel content when the panel is re-used on the same page)
Attachments
Attachments
Issue Links
- breaks
-
WICKET-4425 Wicket 1.5 rewrites template content where it should not
- Resolved
- is blocked by
-
WICKET-3597 Wicket 1.5 RC-3 Bug with conditional comments
- Resolved