mrsoyer Posted June 15, 2010 Share Posted June 15, 2010 Bonjour à tous j'essaye désespérément d'intégrer un code javascript entre les head dans le header.tplcelui ci marche niquel <link rel="stylesheet" type="text/css" href="{$content_dir}js/shadowbox/shadowbox.css"> [removed][removed] [removed] Shadowbox.init(); [removed] alors que celui ci me fait tout planter <link rel="stylesheet" type="text/css" href="{$content_dir}js/shadowbox/shadowbox.css"> [removed][removed] [removed] Shadowbox.init({ // let's skip the automatic setup because we don't have any // properly configured link elements on the page skipSetup: true }); window.onload = function() { // open a welcome message as soon as the window loads Shadowbox.open({ content: 'Welcome to my website!', player: "html", title: "Welcome", height: 350, width: 350 }); }; [removed] Link to comment Share on other sites More sharing options...
BVince Posted June 15, 2010 Share Posted June 15, 2010 Bonjour,Écris ta fonction avec les balises comme ci-dessous : {literal} Code JS {/literal} Link to comment Share on other sites More sharing options...
jeckyl Posted June 15, 2010 Share Posted June 15, 2010 Salut,Rappelons que le { et le } sont réservé SMARTY dans les tpl donc si il y en a dans le javascript cela plante lamentablement. Donc il faut utiliser la technique proposé par BVince.Je rappel l'adresse de la documentation SMARTY : http://www.smarty.net/manual/fr/ Link to comment Share on other sites More sharing options...
Cédric Posted June 16, 2010 Share Posted June 16, 2010 ou utiliser les {rdelim} {ldelim} ,la solution de BVince est effectivement la moins fastidieuse ;-) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now