title: How to load file based on data attribute?
body: <p>How to load a file based on data attribute?</p>
  
  <p>For some reason $(this) does not seems to work.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>if ($('.html').data('load-file')) {
    $(this).load($(this).data("load-file") + ' ' +   $(this).data("load-content"));
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
      margin: 0;
      padding: 0;
  }
  
  .html {
      width: calc(100% - 10px);
      height: 80px;
      margin: 10px;
      background: #f6f6f6;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div 
    class="html" 
    data-load-file="../index.html" 
    data-load-content=".icon_environment"&gt;&lt;/div&gt;
  
  &lt;div class="html"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>