Patches item #1482488, was opened at 2006-05-05 13:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684977&aid=1482488&group_id=119783

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Benjamin Hawkes-Lewis (webben)
Assigned to: Nobody/Anonymous (nobody)
Summary: Escape inline javascript for better XHTML compliance

Initial Comment:
As per http://www.w3.org/TR/xhtml1/diffs.html#h-4.8,
scripts within inline <script> elements must be
escaped, e.g.:

<script type="text/javascript">
<![CDATA[
... unescaped script content ...
]]>
</script>

XHTML validators complain if this is not done.

As this would be a hassle to deal with everytime we
want to insert some javascript, it makes sense for
Wicket to do this automatically with its
wicket.util.string.JavascriptUtils.class.

The attached diff adds two fields to the class,
containing the opening and closing tags for CDATA. It
modifies writeOpenTag and writeCloseTag to write these
respectively after and before the opening and closing
script tags.

writeJavascriptUrl (the method for referencing external
javascript files) is of course left untouched, as there
is no content to escape.

What I didn't know is whether to make this a little
prettier some new lines should be inserted somewhere.
But as the current methods don't do that, I didn't
change that behaviour.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684977&aid=1482488&group_id=119783


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to