title: jQuery and data-attributes to handle all ajax calls?
body: <p>I'm thinking of a way to reduce the amount of javascript code by enabling ajax on links from attributes. Example:</p>
  
  <pre><code>&lt;a href="/Default/Link.html" data-endpoint="/Ajax/Link.html" rel="targetId" async="true"&gt;Click me!&lt;/a&gt;
  </code></pre>
  
  <p><code>async="true"</code> will disable default behaviour of the link (<code>href</code>), and do a ajax call using the <code>data-endpoint</code> value and insert it to the element id defined in <code>rel</code>. </p>
  
  <p>I'm no JS expert, so I'd appreciate any thoughts or pitfalls using this approach. Options like cache: true etc would be cool to be able to pass in as well, but not really needed as I'd like to do this to get partial views that contains more or less live data ( no cache needed).</p>
  
  <p>(This is inspired from a talk i saw on how facebook minimized their code, but probably very simplified compared to how they optimize everything down to every bit 'n byte)</p>