One-page website - Including html files into a "master" html
<p>I'm trying to make an one-page website using jQuery. So I thought to have a master index.html file that has all the css/jquery files included and inside that index.html, a div( div id="page" ) where I put all the html from the other pages.</p>

<p>And then I had the following problem: If one of my "sub-pages" that I wanted to include into my index.html, needed javascript, I needed to include all that scripts into that sub-page, not into index.html. This is a big problem because I don't want to include same scripts over and over again in each "sub-page".</p>

<p>I've used $.get function to do this and then an $('...').html(...)
I googled alot searching for a solution, but couldn't find one. Does any one had an idea on how could I do this?</p>

<p>/** EDIT **/
For a better understanding:I'm searching my menu ul li and take all the links from href and put them in an array.After that for each link in that array i'm getting the html code and store it in a variable.</p>

<pre>
    allMenuLinks = ['about','gallery',etc]

    howManyLinksInMenu = allMenuLinks.length;
    $.each(allMenuLinks, function(index, page) {
       $.get("pages/" + page + ".html", function(content) {
           pagesContent[page] = content;
           howManyLinksInMenu = howManyLinksInMenu - 1;
           howManyLinksInMenu == 0 ? changePage() : '' ;
       }, "html")
    })

And on changePage i have $('#page').html(pagesContent[page]) with some animations.
</pre>
