Description
wicket-ajax-jquery.js#processScript adds an inline script using Wicket.Head.addJavascript, in opposition to Wicket.Head.addElement for an outline script.
The problem is that #addJavascript modifies the script content in any case, with: content = 'try
{'+content+'}catch(e)
{Wicket.Log.error(e);}';
But a script element may contains content that is not designed to be executed nor be javascript: that's the case of a jQuery Template for instance (where the tag signature look like <script id="my-id" type="text/x-jquery-tmpl">). That's also true for other known mine/type, like text/ecmascript, text/vbscript, text/tcl. And for customized ones, at least: text/x-handlebars, text/x-kendo-template, text/x-underscore-template...
Therefore, I think ajax wicket should add script elements using #addJavascript, only if the mime type is text/javascript or is empty (because it is the default scripting language in HTML5 and the declaration can be omitted). In the other cases, it should add the script element to the DOM "as-is", using #addElement.
Thanks in advance & best regards,
Sebastien.