title: Call to function in parent from .JS file from inside iframe
body: <p>I have JS file with uploader functionality.
  This file called from an iframe window.
  I need to show alerts to user according to his actions.</p>
  
  <p>Here is what I've done and it's not works:</p>
  
  <p><strong>From JS file:</strong></p>
  
  <pre><code>$('#btnUpload').on('click', function(){
      parent.CallToParent();
  });
  </code></pre>
  
  <p><strong>And from UploaderWindow call to:</strong></p>
  
  <pre><code>function CallToParent()
  {
     parent.ShowAlert();
  }
  </code></pre>
  
  <p><strong>And on main window:</strong></p>
  
  <pre><code>function ShowAlert()
  {
     alert('some alert');
  }
  </code></pre>