Re: [SMARTY] Problem with JavaScript in templates

From: Date: Thu, 31 Oct 2002 19:25:37 +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-6298@lists.php.net to get a copy of this message
Use the Smarty {literal} tag before and after the script. Sample: {literal} <script language="Javascript"> alert('xxx'); </script> {/literal} On Thu, 31 Oct 2002, Geranium wrote: > Date: Thu, 31 Oct 2002 11:53:47 +0100 > From: Geranium <vlcc69jfbo001@sneakemail.com> > To: smarty-general@lists.php.net > Subject: [SMARTY] Problem with JavaScript in templates > > 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? > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.smarty.general (#6298) next »