On Fri, Jan 29, 2010 at 2:29 PM, Wagner Moratelli <[email protected]>wrote:

> I am try put some code in tag <body> of ticket form, but it don't appears
> on source code of page:
>
> source code ticket.html
> </head>
>
>   <body onload="alert('in onload');"> <!-- Here put some js code on onload
> or other page event -->
>
>
The ticket.html includes the layout.html page, which uses a match template
to match the <body> tag, and replace it.  The replacement does not carry the
attributes of the body tag through into the final render - so that is
stripping out your javascript.

Changing the body tag to  <body py:attrs="select('@*')"> in layout.html
should get your javascript back -- but I think the suggestion by Olemis is
certainly a better way to go about it.

If you look at
http://trac.edgewall.org/browser/trunk/trac/templates/layout.html, I'm
talking about line 37 - but that might be different depending on what
version you have.



>     <py:def function="commentref(prefix, cnum)">
>       <a href="#comment:$cnum"><small>$prefix$cnum</small></a>
>     </py:def>
>
>

You've defined a function with that code, which will not actually render
anything unless you call that function with something like
${commentref(prefix,cnum)} elsewhere in the page. You probably just want to
strip out the <py:def> tags altogether though...

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to