You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/03/17 20:25:42 UTC

[jira] [Commented] (WICKET-6340) The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for multipart forms

    [ https://issues.apache.org/jira/browse/WICKET-6340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15930650#comment-15930650 ] 

ASF subversion and git services commented on WICKET-6340:
---------------------------------------------------------

Commit 1421ea2dc9207143cdadb735f3c79421674d924d in wicket's branch refs/heads/master from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=1421ea2 ]

WICKET-6340 improve support for XHTML markup


> The Ajax reponse of an AjaxSubmitButton creates invalid XHTML markup for multipart forms
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-6340
>                 URL: https://issues.apache.org/jira/browse/WICKET-6340
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 7.6.0, 6.26.0
>         Environment: Jetty 9, Fedora 25
>            Reporter: Marcus
>            Priority: Minor
>              Labels: patch, triaged
>         Attachments: wicket-ajax-jquery-iframe.zip, wicket-ajax-jquery.patch
>
>
> My web pages are delivered as XHTML5 ({{response.setContentType("application/xhtml+xml");}}). When I add a multipart form and submit a file, I get strange JavaScript errors about invalid or illegal strings.
> {quote}
> Wicket.Ajax:  An error occurred while executing Ajax request:SyntaxError: An invalid or illegal string was specified 
> XML Parsing Error: mismatched tag. Expected: </iframe>.
> Address: 
> Row Nr. 1, Column 202:
> {quote}
> I found out that Wicket’s Ajax code is responsible for those problems.
> {code:title=wicket-ajax-jquery.js, row 70|borderStyle=solid}
> createIFrame = function (iframeName) {
>   var $iframe = jQuery('<iframe name="'+iframeName+'" id="'+iframeName+
>     '" src="about:blank" style="position: absolute; top: -9999px; left: -9999px;">');
>   return $iframe[0];
> };
> {code}
> The iframe tag isn’t closed. This is fine for HTML5, but not for XHTML5.
> I have attached a quite minimal Wicket project were the problems can be examined:
> {code}
> mkdir wicket-ajax-jquery-iframe
> mv wicket-ajax-jquery-iframe.zip wicket-ajax-jquery-iframe
> cd wicket-ajax-jquery-iframe
> unzip wicket-ajax-jquery-iframe.zip
> mvn package
> mvn jetty:run-war
> {code}
> Open your browser’s console and upload any file on localhost:8080.
> A patch which fixes this issued is attached. Thanks for your help.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)