mkbond777 Posted September 20, 2014 Share Posted September 20, 2014 (edited) Hi I want to add a small javascript code. But I don't know where to add it. This code is to notify my customers if they are using a outdated browsers. Here is the code: <script type="text/javascript"> var $buoop = {}; $buoop.ol = window.onload; window.onload=function(){ try {if ($buoop.ol) $buoop.ol();}catch (e) {} var e = document.createElement("script"); e.setAttribute("type", "text/javascript"); e.setAttribute("src", "//browser-update.org/update.js"); document.body.appendChild(e); } </script> Thanks In Advance Edited September 20, 2014 by mkbond777 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 21, 2014 Share Posted September 21, 2014 you can paste it between <head> tags in your header.tpl file located in theme file remember about {literal} {/literal} code because your snippet uses brackets 1 Link to comment Share on other sites More sharing options...
mkbond777 Posted September 25, 2014 Author Share Posted September 25, 2014 you can paste it between <head> tags in your header.tpl file located in theme file remember about {literal} {/literal} code because your snippet uses brackets Hi Vekia Thanks for the reply. But can you please help me in writing the above code in {literal} {/literal} code because I am not good in smarty. Thanks Link to comment Share on other sites More sharing options...
vekia Posted September 25, 2014 Share Posted September 25, 2014 {literal} <script type="text/javascript"> var $buoop = {}; $buoop.ol = window.onload; window.onload=function(){ try {if ($buoop.ol) $buoop.ol();}catch (e) {} var e = document.createElement("script"); e.setAttribute("type", "text/javascript"); e.setAttribute("src", "//browser-update.org/update.js"); document.body.appendChild(e); } </script> {/literal} voila ;-) 1 Link to comment Share on other sites More sharing options...
Recommended Posts