javascript includes problems and pitfalls
<p>What kind of problems and pitfalls can one encounter while doing javascript includes (<code>&lt;script src="sample.js" type="text/javascript&gt;&lt;script&gt;</code>) and how to avoid them?</p>

<p>I'm asking this because I just ran into an issue where I wrote my javascript code inside a velocity template file which is included in an overall layout template. The layout template has many different javascript included. My javascript code works just fine on a page by itself, but when included with the layout template, it started to break. (No javascript errors, but things weren't working). </p>
