myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ganesh Jung (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (MYFACES-2585) ajax doesn't work if target contains script with CDATA
Date Mon, 08 Mar 2010 07:49:27 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-2585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842563#action_12842563
] 

Ganesh Jung commented on MYFACES-2585:
--------------------------------------

This discussion confuses me. Werner, could you please shed some light on it?

How would the update section of the xhr response look like for this xhtml snippet if you used
Jims escape solution?

<h:panelGroup id="test"><script type="text/javascript">//<![CDATA[
alert("running");
//]]></script><h:inputText value="#{numberBean.myNumber}" /></h:panelGroup>


Currently this leads to:

<update><![CDATA[<span id=".."><script type="text/javascript">//<![CDATA[
alert("running");
//]]></script><input type="text" ... /></span>//]]></update>

which is obviously wrong.

Wouldn't escaping result in:

<update><![CDATA[<span id=".."><script type="text/javascript">//<![CDATA[
alert("running");
]<![CDATA[]>]]></script><input type="text" ... /></span>//]]></update>

?And how is the Javascript meant do deal with this?


> ajax doesn't work if target contains script with CDATA
> ------------------------------------------------------
>
>                 Key: MYFACES-2585
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2585
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-2
>         Environment: Javascript, API, IMPL...
>            Reporter: Ganesh Jung
>            Priority: Critical
>
> This doesn't work:
> 	    	<h:inputText value="#{numberBean.myNumber}">
> 				<f:ajax render="test" />
> 	    	</h:inputText>
> 	    	<h:panelGroup id="test">
> 			    <script type="text/javascript">
> 			    	//<![CDATA[
> 					alert("running");
> 					//]]>
> 				</script>
> 		    	<h:inputText value="#{numberBean.myNumber}" />
> 	    	</h:panelGroup>
> But this works fine:
> 	    	<h:inputText value="#{numberBean.myNumber}">
> 				<f:ajax render="test" />
> 	    	</h:inputText>
> 	    	<h:panelGroup id="test">
> 			    <script type="text/javascript">
> 					alert("running");
> 				</script>
> 		    	<h:inputText value="#{numberBean.myNumber}" />
> 	    	</h:panelGroup>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message