Where to put javascript for a theme
Permalink
This is a two part question actually:
1. Where do I put the javascript for a theme I am building? Do I put in the the "js" folder or in a "js" folder I create **inside** of my theme folder?
2. Is there a special way to reference / link to my javscript? For example I know with stylesheets the way to do it is:
1. Where do I put the javascript for a theme I am building? Do I put in the the "js" folder or in a "js" folder I create **inside** of my theme folder?
2. Is there a special way to reference / link to my javscript? For example I know with stylesheets the way to do it is:
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
To link to the JS file I usually use $this->getThemePath(), like so:
HTH :)