<mce:script type="text/javascript"><!-- function excelPrint(FileName){ var tempStr = document.getElementById('sort_table').outerHTML; var newWin = window.open(); newWin.document.write(tempStr); newWin.document.close(); newWin.document.execCommand('saveas',true,FileName+'.xls'); newWin.window.close(); } // --></mce:script>