一直使用的window.location.href做文件下載,今日收到反饋說在IE11下面會出現http400的錯誤,其它瀏覽器均正常。
處理辦法:
比如下載路徑中有參數name=石家莊 用方法encodeURI()處理下再傳就不會出問題了,encodeURI() 函數可把字符串作爲 URI 進行編碼。
例:window.location.href= "index?id="+id+"&name="+encodeURI(name)
一直使用的window.location.href做文件下載,今日收到反饋說在IE11下面會出現http400的錯誤,其它瀏覽器均正常。
處理辦法:
比如下載路徑中有參數name=石家莊 用方法encodeURI()處理下再傳就不會出問題了,encodeURI() 函數可把字符串作爲 URI 進行編碼。
例:window.location.href= "index?id="+id+"&name="+encodeURI(name)
Couldn’t find preset “es2015” relative to directory問題解決 npm install babel-preset-es2015 --save-dev