title: Avoid duplicate Javascript inside iframes
body: <p>Here is a wireframe to ilustrate the structure of a legacy project that shows some  performance issue:</p>
  
  <p><img src="https://i.stack.imgur.com/KKgQT.png" alt="enter image description here"></p>
  
  <p>For all dialogs (From jQuery UI) open a new iframe are created and all js from Home are re-downloaded and all objects are re-instanced. Can I create a reference from jQuery from Home to all new iframes and work in each iframe <strong>isolated</strong> scope?</p>
  
  <p>For example: </p>
  
  <p><strong>[Home scope]</strong></p>
  
  <pre><code>$("#some-el").data('foo', 'bar');
  console.log($("#some-el").data('foo')); // results bar
  </code></pre>
  
  <p><strong>[App1 scope]</strong></p>
  
  <pre><code>//after defined in Home first run
  console.log($("#some-el").data('foo')); // results undefined
  </code></pre>
  
  <p><strong>PS:</strong> Remember this is a legacy architeture and all solutions must be consider this scenario.</p>