javascript - Saving a file on Windows Phone 8.1 (mobile IE) -


i'm developing web application 1 may save configuration data json file on computer. approach works fine on desktop browsers (ie11, chrome, ff) , on tested android device. in mobile ie on wp8.1 there happens nothing , on ios devices file shown rather downloaded. here code:

var savetofile = function () {      var       = document.createelement("a"),         blob    = new blob([getuserconfigs()/*get json somewhere*/], {type:"application/json"}),         fname   = "fileabc";      //check ms ie fileapi     if (window.navigator.mssaveblob) {          a.onclick = function(e) {             e.stoppropagation();             window.navigator.mssaveblob(blob, fname);         };     //otherwise use html5 standard     } else {         a.setattribute("href", window.url.createobjecturl(blob));         a.setattribute("download", fname);          a.onclick = function (e) {             e.stoppropagation();         };     }      document.body.appendchild(a);     a.click();     document.body.removechild(a); };  $("#savebtn").click(savetofile); 

what's missing? how work on mobile ie/safari? on desktop works fine. :)


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -