title: Save a page with javascript
body: <p>I have a jsp page which contains a table with id 'department'. There is a button named 'Save'. When I click Save button then it should give an option to save the department table as text file or pdf. For this I write a javascript function. But its not working. Can anybody help me? My javascript function is given below--</p>
  
  <pre><code>function Save() {
      var saveContent = document.getElementById("department");
      document.execCommand("SaveAs",true, saveContent);
  }
  </code></pre>