This article for Bo Master Original, reproduced please indicate the source:
When the POI is applied for export, the POI is applied to encapsulate the data, the data is encapsulated in Excel, and then the download download operation is done to complete
POI export operation. As the download operation, the browser will be differentiated and adapted to be exported separately. Due to less adaptation, resulting in IE browser
Export has failed to export.
Finally found that in JS does not recognize the adaptation of IE, the method is applied as follows:
function Getbrowserinfo () { = {}; = navigator.userAgent.toLowerCase (); =/(Msie|firefox|chrome|opera|version). *? ([\d.] +)/; = Ua.match (re); Try { = M[1].replace (/version/, "' Safari"); = M[2]; } Catch (e) { Console.log ("getbrowserinfo fail.") ) } return Sys;}
The above method will be identified in JS and return the corresponding browser type.
Here's how to modify it later:
functionMybrowser () {varuseragent = navigator.useragent;//get the useragent string for the browser varIsopera = Useragent.indexof ("Opera") >-1;//determine if Opera browser varIsie = Useragent.indexof ("compatible") >-1 && useragent.indexof ("MSIE") > 1 &&!isopera ;//determine if IE browser varIsedge = Useragent.indexof ("Edge") >-1;//determine if IE's Edge browser varIsFF = Useragent.indexof ("Firefox") >-1;//determine if Firefox browser varIssafari = Useragent.indexof ("Safari") >-1 && useragent.indexof ("Chrome") = = 1;//determine if Safari browser varIschrome = Useragent.indexof ("Chrome") >-1 && useragent.indexof ("Safari") >-1;//determine the Chrome browser if(Isie) {varReie =NewRegExp ("MSIE (\\d+\\.\\d+);"); Reie.test (useragent); varFieversion = parsefloat (regexp["$"]); if(Fieversion = = 7) { return"IE7"; } Else if(Fieversion = = 8) { return"IE8"; } Else if(Fieversion = = 9) { return"IE9"; } Else if(Fieversion = = 10) { return"IE10"; } Else if(Fieversion = = 11) { return"IE11"; } Else { return"0"; }//IE version is too low return"IE"; } if(Isopera) {return"Opera"; } if(Isedge) {return"Edge"; } if(IsFF) {return"FF"; } if(Issafari) {return"Safari"; } if(ischrome) {return"Chrome"; } }
After the browser in the background to adapt, then you can export the success.
JS to get the current browser type