javascript - safari is taking unknown file format while exporting html table to excelsheet -


i have issue. exporting html table data excel sheet .its not working in safari properly.its downloading unknown file format sheet. explaining code below.

<div id="sites">     <table>       <thead>         <tr>           <th>site</th>           <th>address</th>         </tr>       </thead>       <tbody>         <tr>           <td>oditek</td>           <td>bhubaneswar</td>         </tr>         <tr>           <td>khojakhoji</td>           <td>cuttuck</td>         </tr>       </tbody>       </table>       </div> <input type="button" class="btn btn-success"   id="savedata" value="export"   style="margin-right:20px;" onclick="checkbrowser();" /> 

the javascript code given below.

function checkbrowser(){    var url='data:application/vnd.ms-excel,' + encodeuricomponent($('#sites').html())     location.href=url    return false } 

these above code working in other browser fine in safari downloading unknown format file need download excel sheet.please me.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -