Hi Howard,

Thanks for your response.

In the web app I am working on. I did have a Javascript in a .js file and
reference it. In the code example, I just want to simplify the codes by
using inline javascript codes. 

The problem now is not that it can not reference the method, but it popups
javascript error "syntax error" when the ajax block codes are renderred
after the link invocates the Ajax call. Somehow, IE does not like the single
quotes used to pass parameters. Like I said, it does not have any problems
in FF.

When you mentioned "Static", I do not know what you mean? in my case, the
parameters passed in have to be loaded dynamically because we are using a
single text editor to edit many text areas so that each area(called content
block) will have a unique id. 

So I kind of feel that somehow when Tapestry rendered the codes in an Ajax
block, it does somethings IE does not like. Too bad I can not see the codes
behind. 

If you can not understand the problem completely, can you just copy the
codes to run in IE?  you will see the problem I described here.

Thanks for your help!

David, 



Howard Lewis Ship wrote:
> 
> 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
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Javascript-error-in-IE-when-a-javascript-call-in-an-Ajax-block-tp27761290p27761694.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

Reply via email to