Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Assigner variable dans javascript

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
lan19
Smarty Rookie


Joined: 18 Mar 2011
Posts: 12

PostPosted: Sat May 10, 2014 10:31 pm    Post subject: Assigner variable dans javascript Reply with quote

Bonjour,


J'ai un fichier tpl comme suit :
Code:

{literal}
           <script type="text/javascript">
            var options = {
               script:"test.php?json=true&",
               limit:5,
               json:true,
               cache:false,
            };
         </script>
{/literal}


Je voudrais remplacer la valeur 5 par une variable déja assignée {$value}.

J'essaie :

Code:

{literal}
           <script type="text/javascript">
            var options = {
               script:"test.php?json=true&",
               limit:{ldelim}{$value}{rdelim},
               json:true,
               cache:false,
            };
         </script>
{/literal}


mais le script ne marche pas.
Comment remplacer cette valeur par cette variable ?

Merci par avance pour toutes les réponses à venir.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP