Reputation: 1275
I would like to use a different font that is not from the usual font-family.
To include this font in my site, I have a two-line JavaScript code from typekit.com which needs to be put into the pages of my website where this font needs to be applied.
But since I would like to apply this font thru out my website, where should I put this JavaScript code so that the font gets applied thru throughout the site.
I am using Magento 1.6.2.0 version and have created my own theme which sits in app/design/frontend/default/mytheme
and skin/frontend/default/mytheme
If some one could tell me where to put the following JavaScript code,
<script type="text/javascript" src="http://use.typekit.com/ysw8aaa.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
I would be really grateful to them.
Thanks
Upvotes: 2
Views: 6013
Reputation: 3064
Go to /app/design/frontend/base/default/template/page/html/head.html (or whichever template path u are using)
Right above:
<!--[if lt IE 7]>
Add:
<script type="text/javascript" src="http://use.typekit.com/ysw8aaa.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
Something to keep in mind this is a external link so it slows down your site.
Upvotes: -1
Reputation: 27250
According to the knowledge-base and these blogs
<default>
<action method="addJs"><script type="text/javascript" src="http://use.typekit.com/ysw8aaa.js"></script></action>
<action method="addJs"><script type="text/javascript">try{Typekit.load();}catch(e){}</script></action>
</default>
or, more reliably, combine them into a single custom script file and use:
<action method="addJs"><script>yourdir/yourscriptname.js</script></action>
Upvotes: 4