You are here: Re: [SMARTY] Using Smarty with JavaScript « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Using Smarty with JavaScript

Posted by Jochem Maas on 09/30/88 11:13

Alain Williams wrote:
> On Mon, Apr 11, 2005 at 08:21:59PM +1000, Robert Amos wrote:
>
>>On Apr 11, 2005 4:06 AM, Reynier Perez Mira <rperezm@estudiantes.uci.cu> wrote:
>>
>>>Well I have to cases. The fisrt case is this:
>>>{literal} <script language="JavaScript" src="js/validator.js" type="text/javascript"></script>{/literal}
>>
>>You can't include a javascript file with {include} because smarty will
>>try to parse it. {fetch} will simply dump output.
>>
>>However what you originally had with:
>><script language="JavaScript" src="js/validator.js"
>>type="text/javascript"></script>
>
>
> Passing my web pages through the the w3c validator (http://validator.w3.org/)
> it complains about the ''language="JavaScript"'' -- are there any browsers
> that need that tag or can we just drop it and be standards conformant ?

the tag is not the problem, its the 'language' _attribute_ which is not supported
by the DOCTYPE you are using (you don't say which but I guess you are trying to output
a form of XHTML)...

this might help a little:
http://webdesign.about.com/library/tags/bltags-script.htm

so the following should work fine (bare in mind most browsers are very forgiving!):
<script src="js/validator.js" type="text/javascript"></script>

>
>
>
>>will always work fine, because its using a javascript include rather
>>than a smarty one. This means that its included on the client side and
>>goes no where near smarty. You don't need to put {literal} tags around
>>it though, you only use {literal} when there are {'s and }'s in your
>>code that you don't want smarty to parse.
>>
>>There's nothing wrong with the second case from a Smarty point of
>>view, so if there is something not displaying correctly you might need
>>to seek help from someone a little more adept with Javascript.
>>
>>-bok
>>
>>--
>>Smarty General Mailing List (http://smarty.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация