Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [smarty] js w smarty, problem nie dziala
noc_nik
post
Post #1





Grupa: Zarejestrowani
Postów: 95
Pomógł: 0
Dołączył: 24.06.2003
Skąd: Kielce

Ostrzeżenie: (0%)
-----


Witam mam taki problem ze w pliku tpl umieszczam js

  1. <script language="JavaScript" type="text/javascript">
  2. var menus = [
  3. new ypSlideOutMenu("menu1", "down", 1, 29, 185, 230),
  4. new ypSlideOutMenu("menu2", "down", 185, 29, 185, 264),
  5. new ypSlideOutMenu("menu3", "down", 370, 29, 185, 240)
  6.  
  7. ]
  8.  
  9. for (var i = 0; i < menus.length; i++) {
  10. menus[i].onactivate = new Function("document.getElementById('act" + i + "').className='active';");
  11. menus[i].ondeactivate = new Function("document.getElementById('act" + i + "').className='';");
  12. }
  13.  
  14. ypSlideOutMenu.writeCSS();
  15.  
  16. </script>


no i oczywiscie :

Fatal error: Smarty error: [in menu2.tpl line 46]: syntax error: unrecognized tag: menus[i].onactivate = new Function("document.getElementById('act" + i + "').className='active';"); menus[i].ondeactivate = new Function("document.getElementById('act" + i + "').className='';"); (Smarty_Compiler.class.php, line 455) in c:\usr\krasnal\www\sg\Smarty.class.php on line 1092


a jak umieszcze

  1. <script language="JavaScript" src="menu2.js" type="text/javascript"></script>


to nie dziala łaj ?smile.gif


--------------------
:)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




literal
http://www.smarty.net/manual/en/language.f...ion.literal.php


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
ts23
post
Post #3





Grupa: Zarejestrowani
Postów: 12
Pomógł: 1
Dołączył: 20.03.2009

Ostrzeżenie: (0%)
-----


albo w zewnętrzny skrypt
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 12:19