Re: [SMARTY] Problem with JavaScript in templates
| From: | Luc Saint-Elie | Date: | Thu, 31 Oct 2002 10:57:34 +0000 |
| Subject: | Re: [SMARTY] Problem with JavaScript in templates | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6286@lists.php.net to get a copy of this message | ||
Hello,
Did you try :
{literal}
<script language=\"javaScript\">
<!--
function closeWin() {
var closeWin=window.self.close();
}
// -->
</script>
{/literal}
Luc
At 11:53 31/10/2002 +0100, you wrote:
I have some Javascript in my template like this: <script language=\"javaScript\"> <!-- function closeWin() { var closeWin=window.self.close(); } // --> </script> When parsing the template that contains this, Smarty dies with a fatal error: Fatal error: Smarty plugin error: [in string template line 7]: unknown tag - 'var' in /var/www/php/includes/Smarty.class.php on line 1980 It looks like the curly brackets used by JavaScript are confusing Smarty into interpreting JavaScript as Smarty tags. How can I prevent this?