Jump to content

Need to add Small Javascript Code


mkbond777

Recommended Posts

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 by mkbond777 (see edit history)
Link to comment
Share on other sites

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

{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 ;-)

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...