[ 
https://issues.apache.org/jira/browse/WICKET-5047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebastien Briquet updated WICKET-5047:
--------------------------------------

    Attachment: WICKET-5047-wicket-ajax-jquery.js.patch

Attached wicket-ajax-jquery.js patch.
                
> Wicket Ajax: Inline script header contribution issue
> ----------------------------------------------------
>
>                 Key: WICKET-5047
>                 URL: https://issues.apache.org/jira/browse/WICKET-5047
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.5.0
>            Reporter: Sebastien Briquet
>            Assignee: Martin Grigorov
>             Fix For: 6.7.0
>
>         Attachments: WICKET-5047-wicket-ajax-jquery.js.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to