title: Posting data to a iframe then download a file from a link
body: <p>I am having an issue with posting some data to an iframe then for it to download a file from a link.</p>
  
  <p>I have searched stackoverflow for similar questions and have tried to adapt my code to make this work with the information i had found.</p>
  
  <p>Currently it only posts the data to the iframe.</p>
  
  <p>here is my code</p>
  
  <pre><code>&lt;script src="https://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt;
  &lt;form action="http://www.example.com" method="post" target="output_frame" accept-charset='UTF-8'&gt;
  &lt;input type='hidden' name='package_shape' value='box'  /&gt;
  &lt;input type="submit" name='op' id='go' value='download' /&gt;
  &lt;/form&gt;
  &lt;script&gt;
      var downloadUrl = 'http://www.example.com/pdf';
  
      $('#myFrame').on('load', function(){
          console.log('WOOT!', arguments);
      });
  
      $('#go').on('click', function(){
          $('#myFrame').attr('src', downloadUrl);
      });
  &lt;/script&gt;
  &lt;iframe name="output_frame" src="" width="100%" height="500" id="myFrame"&gt;
  &lt;/iframe&gt;
  </code></pre>
  
  <p>If i created a button <code>&lt;button id="go"/&gt;Download&lt;/button&gt;</code> and press it after the page has loaded within the iframe, it downloads the right file.</p>
  
  <p>Thank you in advance.</p>