Detect script support for deferment without testing

Is there a reliable way to detect if the browser supports the <script>defer attribute without testing? I am not interested in creating several script blocks, either deferred or not observing, that are executed in the first place. I am looking for a legitimate feature detection. "defer" in document.createElement("script")returns just trueabout everywhere, giving a lot of false positives.

+3
source share
1 answer

Based on Paul Irish's comprehensive study and article on a script @defer document in a lazyweb request repository, I don't think it deferworks reliably enough, even if you can detect it.

+2
source

Source: https://habr.com/ru/post/1764346/


All Articles