title: How to add javascript to YII correctly?
body: <p>I want to create several javascript function that will be needed on different pages. Most will be relevant only to one page, but some to several. I know if I add general conversion functions, it would be a good idea to just create a new javascript file and put all these generic functions into that one file. Bringing me to my first question:</p>
  
  <ul>
  <li>Where would you store the generic javascript file? In "protected"? Which subfolder?</li>
  </ul>
  
  <p>Then, I need to address the placement of other javascript code. </p>
  
  <ul>
  <li>If I have javascript that will only be used on one page, should I use <a href="http://www.techportal.co.za/yii-framework/439-how-to-add-javascript-to-you-view-files-using-the-yii-framework" rel="nofollow">this technique</a> or should I stick to a similar approach as above?</li>
  </ul>
  
  <p>The emphasis is on doing it correctly. I want to fall exactly in line with the yii framework.</p>