.js file format
<p>I was wondering if there is a good reference to how best to format .js files?  </p>

<p>Do you treat them like you would class files or do you separate out the functionality based off the page it handles?  Do you create .js functions that could be used across several pages or do you write a custom .js file for each page?</p>

<p>I'm just curious if there is a formal way rather than just writing a bunch of functions that may or may not be group together for a specific page or set of pages.  Right now I try to group by the functionality of the page but my .js files are very custom for that page, not sure if they are usable on a different page.</p>

<p><strong>::UPDATE::</strong></p>

<p>Some of the answers have the same theme and mostly about what you plan on doing with the project.  Right now the project is real new to me and the requirements are slow in coming.  So I'm building it page by page.  There could be cross functionality or similar functionality in the future.  Most of the functionality is very specific to the specific page though.</p>

<p>Is it wise to group AJAX calls into a .js but then also have a custompage .js that contains all of the very custom features of the page.</p>
