[Petal] Javascript and CSS

Josh Narins josh at narins.net
Tue Oct 11 15:09:08 BST 2005


Going to do some dynamic javascript, where the function itself is
dynamic, and CSS is basically the same question.

The big question is basically the <!-- and --> which properly goes
around the CSS and javascript for "older" browers.

That wouldn't happen here.

# set the javascript using perl
$tal->{javascript} = "function a(obj) { ... stuff ... }";

#template contains
<script type="text/javascript" petal:content="/javascript" />



Has anyone ever tried anything like this, with javascript, either?
Again, no <!-- and --> will work.

<style type="text/css">
  .classA { <span petal:replace="/usr/style_config/classA" /> }
  .classB { color: blue; }
</style>

Cheers,
Josh


More information about the Petal mailing list