durangod Posted June 11, 2014 Share Posted June 11, 2014 quick question. when adding some js to a tpl file, does the literal go before or after the script tag. i have seen it both ways. for example... like this (1): {literal} <script> whatever... </script> {/literal} or like this (2): <script> {literal} whatever... {/literal} </script> which is proper? thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 11, 2014 Share Posted June 11, 2014 if it helps, I always use the first method... 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted June 11, 2014 Author Share Posted June 11, 2014 Thanks brian, i do as well. But i found one that is the other way and i think its wrong, and i think i did it a long time ago lol.. so i wanted to check to be sure. 0 Quote Link to comment Share on other sites More sharing options...
searley Posted June 11, 2014 Share Posted June 11, 2014 I think the rule is, if it works it's ok 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted June 11, 2014 Author Share Posted June 11, 2014 I believe that is "if it works dont fix it" lol but i did anyway lol 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 11, 2014 Share Posted June 11, 2014 both will work with you, also some times this method used when needed {literal} <script type="text/javascript"> var somename = '{/literal}{$smartyTag}{literal}'; </script> {/literal} this helpful when you need to pass values from smarty to it 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.