开发者

Detect script defer support without testing

Is there a reliable way of detecting if a browser supports the <script> attribute "defer" without testing? I'm not interested in creating multiple script blocks both defered 开发者_如何学JAVAand not and seeing which executes first. I'm looking for legitimate feature detection. "defer" in document.createElement("script") returns true just about everywhere, giving a lot of false positives.


Based on Paul Irish's comprehensive research and article on script @defer document in his lazyweb-requests repository, I don't think defer behaves reliably enough to use even if you could feature detect it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜