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.
精彩评论