duoshuo / airpub

a pure front-end blog engine powered by duoshuo API
http://airpub.io
MIT License
359 stars 41 forks source link

兼容性 / IE lte9 `FormData` 对象兼容性问题 #10

Closed Frederick-S closed 10 years ago

Frederick-S commented 10 years ago
IE Version Issue Errors in Console
9 Blank page 1. airpub-dependencies.min.js: FormData required. 2. airpub-dependencies.min.js: [$injector:modulerr] http://errors.angularjs.org/1.2.21/$injector/modulerr?p0=airpub&p1=%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.2.21%2F%24injector%2Fmodulerr%3Fp0%3Dupyun%26p1%3D%255B%2524injector%253Anomod%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.2.21%252F%2524injector%252Fnomod%253Fp0%253Dupyun
8 Blank page 1. airpub-dependencies.min.js: FormData required. 2. airpub-dependencies.min.js: [$injector:modulerr] http://errors.angularjs.org/1.2.21/$injector/modulerr?p0=airpub&p1=%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.2.21%2F%24injector%2Fmodulerr%3Fp0%3Dupyun%26p1%3D%255B%2524injector%253Anomod%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.2.21%252F%2524injector%252Fnomod%253Fp0%253Dupyun

先 mark 一下。

guo-yu commented 10 years ago

FormData 在 IE 8-9 中应该都是不支持的。这是为了异步上传图片到 又拍云或七牛云用的。考虑到并不是一个前端面对用户的功能,所以非 admin 用户应该是接触不到的~

guo-yu commented 10 years ago

formData 对象只有在 IE10 中才被支持 :( http://stackoverflow.com/questions/15475215/formdata-in-ie8-9

Frederick-S commented 10 years ago

不过由于在加载 upyun.js 的时候直接抛出了异常,if (!window.FormData) throw new Error('FormData required.');,造成没有注入模块到 angular,最后加载 upyun 模块的时候就失败了,所以非 admin 用户进入首页也看不到文章。

guo-yu commented 10 years ago

@Frederick-S 这是个问题。我马上在 upyun 模块中修复成等触发事件时再做检查。

guo-yu commented 10 years ago

这个问题已经在 upyun 模块的新版本中得到解决。Airpub 将在 3.x 版本开始依赖这个新版本 :)