How do you create bigger logical wholes in JS/jQuery (instead of putting everything into document.ready)?
<p>I currently simply have everything inside document.ready, which isn't very optimal for readability and DRYness.</p>

<p>What are the options to create modules/classes/namespaces/function or whatever you call them in jQuery/Javascript?</p>

<p>For example, how would you separate these concerns:</p>

<ul>
<li>A general purpose function that takes an element as parameter and appends the given string into it's name attribute?</li>
<li>Code that prettifies the UI (applies button effects, styling, forms, tabs, etc.)?</li>
<li>Code that handles AJAX</li>
</ul>

<p>Apparently, what I want to know is: How do you structure code in JS? (Thanks Alex!)</p>
