Don't do that.  Put static JavaScript in a .js file and just reference
it.  Use (in 5.2) JavaScript.importJavaScriptLibrary().

On Tue, Mar 2, 2010 at 1:16 PM, DavidWei <xinhua....@rrd.com> wrote:
>
> Hi,
>
> when I am trying to upgrade our web app to Tapestry 5.1.0.5, I have got a
> javascript syntax error when a javascript method with parameters is called
> inside a Ajax block. I have tested many kinds of scenarios, I could not
> figure out the problem.
>
> 1. If the javascript method with parameters is not in a Ajax block, it runs
> fine in IE and FF
> 2. If the javascript method with parameters is in a Ajax block, it runs fine
> in FF, but has a syntax error in IE;
>
> Can someone tell me what is wrong? Thanks a lot.
>
> Here are my codes:
>
>
> Test.tml:
>
> <t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
> xmlns:p="tapestry:parameter">
>        <script type="text/javascript">
>        function copyContentPieceToMceEditor(src, dest, editorId) {
>
>                alert("src=" + src);
>                alert("dest=" + dest);
>                alert("editorId=" + editorId);
>        }
>
>        </script>
>
>         Ajax Call
>
>                        <t:zone t:id="updateZone" >
>                        </t:zone>
>
>                        <t:block t:id="ajaxBlock" >
>                                <table width="100%" cellpadding="0" 
> cellspacing="0">
>                                <tr>
>                                        <td>
>                                                <p>
>                                                         # Edit
>                                                </p>
>                                        </td>
>                                </tr>
>                        </table>
>                        </t:block>
>  </t:layout>
>
> Test.java:
>
> public class Test extends BasePage
> {
>
>       �...@inject
>        private Block ajaxBlock;
>
>        public Block getAjaxBlock()
>        {
>                return ajaxBlock;
>        }
>
>        public Block onActionFromEditContentBlock()
>        {
>                return getAjaxBlock();
>        }
>
> }
> --
> View this message in context: 
> http://old.nabble.com/Javascript-error-in-IE-when-a-javascript-call-in-an-Ajax-block-tp27761290p27761290.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to