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:

<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />

 
melat0nin replied on at Permalink Best Answer Reply
melat0nin
You'd put the javascript within your theme's folder. That can be /themes/[theme name]/js, or whatever you like.

To link to the JS file I usually use $this->getThemePath(), like so:

<script src="<?php echo $this->getThemePath();?>/js/myjsfile.js"></script>


HTH :)