We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在IE浏览器使用时发现css资源加载失败时重试不生效
写了一个简单的demo测试
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script> document.addEventListener('error', function (event) { console.log('load error'); var target = event.target || event.srcElement; console.log(target); }, true) </script> <link rel="stylesheet" href="//test.com/xxx.css" crossorigin="anonymous"> <script src="//test.com/xxx.js" ></script> </head> <body> </body> </html>
发现在chrome能够正常输出两个load error,但是在IE只能输出script的error。感觉像是link标签的error事件在IE监听不到?
load error
The text was updated successfully, but these errors were encountered:
IE在 <link> 设置了 crossorigin="anonymous" 之后,仍然不能获取样式表;并且在 CSS 加载失败的时候只有 load 事件,没有 error 事件,所以无法区分加载成功与失败。
<link>
crossorigin="anonymous"
load
error
目前只能想到一个比较绕的方法来解决:
<link + data-assets-retry-style-checker="sync" type="text/css" rel="stylesheet" href="/e2e/fixture/styles/sync.css" />
+ link[data-assets-retry-style-checker="sync"] { + animation-name: sync; + }
(上面两步可以通过打包插件实现)
CSS
data-assets-retry-style-checker
cssRules
link
animation-name
Sorry, something went wrong.
No branches or pull requests
在IE浏览器使用时发现css资源加载失败时重试不生效
写了一个简单的demo测试
发现在chrome能够正常输出两个
load error
,但是在IE只能输出script的error。感觉像是link标签的error事件在IE监听不到?The text was updated successfully, but these errors were encountered: