Adding Javascript to a website
<p>I have been making websites by myself for a few months now and although I understand the concept of how to add Javascript to a site, I am really struggling with how to best go about it and would have liked some experienced developers opinions/advice.</p>

<p>I have read countless times on SO that it is best practice to build a plain site first and then go about adding Javascript. That way the site will work pretty much no matter what. It's a great idea for stuff like animations, basically, Javascript which acts on the page.</p>

<p>But, if you have a site with server generated content. And say, that to shorten load time on your pages you would like to then have part of your content loaded via ajax calls. How do you go about adding that to the site?</p>

<p>As far as I understand you cannot know at the server whether your client has Javascript enabled or disabled when the page refreshes... so you can't leave content out at the server. But if you send all of it to the client then you don't need an ajax on the page anymore.</p>

<p>How do you normally go about it in this case? Do you make links for  and  versions and signal the server which version to load that way?
But that still doesn't tell you whether or not the user will have scripts enabled at refresh or not...</p>

<p>Or do you just do like facebook and ebay and ignore users with scripts disabled?</p>
