Monday, August 2, 2004

Javascript & Flexy

If you ever used Flexy, which I consider a really great TE, you have most probably already stumbled across Flexy's inability to step into <script> blocks.

A really easy method to overcome this problem is to define scriptOpen and scriptClose properties in your base objects outputted by Flexy:


class FlexyObject {
$scriptOpen = "n<script type="text/javascript"> <!--n";
$scriptClose = "n//--> </script>n";
$scriptData = "var foo = 'bar';";

Outputting above object with the following template wont work:

<script type="text/javascript">


</html> like a charm... ;)

Alan said, Flexy wont step into Javascript blocks because that caused massive problems with the Smarty convertor...

No comments:

Post a Comment