Hi,

If you want to export tmpl_context vars in js, you can do this by
calling your vars like that (it can only work in a template, not in
a .js file because genshi or Mako do not pars any vars in the public
folder):

<script type="text/javascript">
var imported_tmpl_var = ${c.tmpl_var}
</script>

Tip: if your var is a string, you must protect it with quotes.

Damdamdeshauts

On Jan 9, 7:32 am, Chen Houwu <[email protected]> wrote:
> I have tried the following code, but it does not work
> ----------------snippet in "my_template.html"-------------------
> <javascript>
>     myfunction(${tmpl_context.something})
> </javascript>
> -------------------------------------
>
> How can I incorporate javascript code and genshi template?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to