Thursday, March 10, 2011

Invoking Download in Javascript

<html>
     <head>
    </head>
<body>
   <table border='0'>
       <tr>
                <td><font onclick="startDownload ()">Download</font></td>
      </tr>
  </table>
</body>
    <script type="text/javascript" language="javascript">
      function startDownload ()
      {
              var windowStyle = "height=500, width=500, left=5, top=5, status=no, toolbar=no, " +
               "menubar=no, location=no, resizable=no, scrollbars=no";
 
              var url='<File Path>';  
              window.open(url,'Download', windowStyle );
     }
    </script>
</html>

No comments: