neel k

neel k

  • 1.8k
  • 143
  • 99.1k

Jquery export to excel

Jul 28 2015 4:37 PM
hi,
This is my jquery export to excel script. it is working in chrome but not working in IE 9,10,11 .
<script>
$(document).ready(function () {
$("#export").click(function (e) {
window.open('data:application/vnd.ms-excel,' + encodeURIComponent($('#tblExport').html()));
e.preventDefault();
});
});
</script>
In IE it is showing like this in URL bar. 
 
data:application/vnd.ms-excel, <table align="center" id="tblExport" style="width: 100%;" border="1" cellspacing="0"> <thead> <tr class="table-header" style="width: 100%;"> <th style="width: 20%; padding-left: 10px;"> country_ab </th> <th style="width: 20%; padding-left: 10px;"> country </th> <th style="width: 20%; padding-left: 10px;"> region_ab </th> <th style="width: 20%; padding-left: 10px;"> world_area_ab </th> <th style="width: 20%; padding-left: 10px;"> last_updated </th> <th style="width: 20%; padding-left: 10px;"> notes_country_ab </th> <th style="width: 20%; padding-left: 10px;"> parent_country_ab </th> <th style="width: 20%; padding-left: 10px;"> restriction </th> <th style="width: 20%; padding-left: 10px;"> LC_id </th> <th style="width: 20%; padding-left: 10px;"> has_states </th> </tr> </thead> <tbody><tr id="ManageUsers_gri
 
 
Thanks,

Brought to you by:

Answers (4)