You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in nashua <nh...@hotmail.com> on 2008/02/01 17:10:34 UTC

@Script component - possible DOJO bug, help appreciated

Folks,
 
I am using the @Script component inside a for loop rather successfully and proper javascript is being rendered in the markup. 
 
BUT I am receiving a javascript error message box on IE7.
 
     Error: expected ')'
 
and another subsequent
 
    Error: Object expected
 
The error occurs on the same line...
decorateTransparentText_0();
 
Basically I pass a parameter named 'index' into my @Script . 
My script iterates image dom's and decorates IMG doms with plain text. The index parameter is appended to the end of each decoration function, since a unique function applies for each loop iteration from the template.
 
Here is the markup showing the dynamically named function calls (notice my dynamic index _0, _1, etc alot like the way tacos codes...)
 
<script type="text/javascript"><!--dojo.addOnLoad(function(e) {dojo.require("tapestry.form");tapestry.form.registerForm("galleryForm");decorateTransparentText_0();decorateTransparentText_1();decorateTransparentText_2();decorateTransparentText_3();
 
All looks fine except for the starting html comment hanging off the right end of the first line.
 
Can anyone comment on this?
 
The code runs in firefox without error dialog. But I do not see my doms decorated.
 
I removed ALL <!-- comments from my *.script modules and templates. 
Thanks in advance for your valued assessment.
Best regards 
Ken in nashua
_________________________________________________________________
Helping your favorite cause is as easy as instant messaging. You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join

Re: @Script component - possible DOJO bug, help appreciated

Posted by Kevin Menard <km...@servprise.com>.
I'm not sure what the problem is, but I agree that the comments around the
script should be removed.  I'm unaware of any modern browser that still
requires this relic.  Older browsers that do are likely to get tripped up by
the lack of "language" attribute anyway.  I'll file a JIRA for it.

-- 
Kevin


On 2/1/08 11:10 AM, in article BAY120-W225EE82A7E3396EDF5ACA2C9300@phx.gbl,
"Ken in nashua" <nh...@hotmail.com> wrote:

> 
> Folks,
>  
> I am using the @Script component inside a for loop rather successfully and
> proper javascript is being rendered in the markup.
>  
> BUT I am receiving a javascript error message box on IE7.
>  
>      Error: expected ')'
>  
> and another subsequent
>  
>     Error: Object expected
>  
> The error occurs on the same line...
> decorateTransparentText_0();
>  
> Basically I pass a parameter named 'index' into my @Script .
> My script iterates image dom's and decorates IMG doms with plain text. The
> index parameter is appended to the end of each decoration function, since a
> unique function applies for each loop iteration from the template.
>  
> Here is the markup showing the dynamically named function calls (notice my
> dynamic index _0, _1, etc alot like the way tacos codes...)
>  
> <script type="text/javascript"><!--dojo.addOnLoad(function(e)
> {dojo.require("tapestry.form");tapestry.form.registerForm("galleryForm");decor
> ateTransparentText_0();decorateTransparentText_1();decorateTransparentText_2()
> ;decorateTransparentText_3();
>  
> All looks fine except for the starting html comment hanging off the right end
> of the first line.
>  
> Can anyone comment on this?
>  
> The code runs in firefox without error dialog. But I do not see my doms
> decorated.
>  
> I removed ALL <!-- comments from my *.script modules and templates.
> Thanks in advance for your valued assessment.
> Best regards 
> Ken in nashua
> _________________________________________________________________
> Helping your favorite cause is as easy as instant messaging. You IM, we give.
> http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join



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