title: Using jQuery to create server side includes
body: <p>I want to use jQuery to create server side includes, but I'd like to create a method to generate the content automatically based on the "title" attribute of the inserted  element, such as:</p>
  
  <pre><code>&lt;div class="js-include" title="nav.html"&gt;&lt;/div&gt;
  &lt;div class="js-include" title="table.html"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>That way one script could be used to generate multiple content elements.</p>
  
  <p>The content files are stored in the same folder as the base file. Here is the script I am trying to use, but it's not working:</p>
  
  <pre><code>&lt;script&gt;
  $(".js-include").each(function(){
      var inc=$(this);
      $.get(inc.attr("title"), function(data){
          inc.replaceWith(data);
      });
  });
  &lt;/script&gt;
  </code></pre>