title: Download html content loaded inside iframe
body: <p>I have an iframe which displays an HTML page. There's an ajax call to server which creates the HTML file and returns the path to file as a response, to which I dynamically create iframe and display it.</p>
  
  <p>Now, I need to know, is there a way I can allow user to download that HTML file from that iframe? May be a button which when clicked, does the downloading.</p>
  
  <p>How can i extract that? Sorry if the question is not framed correctly. I am trying my best.
  Below is the code to display the HTML file</p>
  
  <pre><code>$.ajax({
      url: 'diffReport?url='+url,
      success:function(data){
          var div = document.getElementById("diffReport");
          div.innerHTML = '&lt;iframe style="width:100%;height:100%;" frameborder="0" src="'+data+'" /&gt;';
      },
      error: function(xhr, status, error) {
          var err = eval("(" + xhr.responseText + ")");
          console.log(err);
      }
  });
  </code></pre>
  
  <p>After the ajax call to a servlet, a physical HTML file is created within the server directory. Now am not able to understand how to give user/client the liberty to download that file to his local system.</p>
  
  <p>Please suggest.</p>