Re:How a new HTML element will make the Web faster
by hrjet on Tuesday September 02, 2014 @01:11AM
(#8255918)
Good point about JS.
But there are potentially more types of media (audio, video, html via frames, etc).
Even if a general solution isn't applicable to JS, it can have lots of other uses.
Re:How a new HTML element will make the Web faster
by eurleif on Tuesday September 02, 2014 @01:56PM
(#8259079)
>html via frames
That has the same problem as JS, especially when you realize that framed pages on the same domain can interact with the parent's DOM.
Re:How a new HTML element will make the Web faster
by tg3 on Tuesday September 02, 2014 @01:20AM
(#8255932)
the <picture> tag is set up very similarly to the audio and video tags, so I think that even if this specific solution isn't general, the pattern can be applied generally to other types of media.
Of course, you could limit the media queries that could be used with JavaScript, but then your general solution isn't really so general anymore. And there's already a way to dynamically load scripts, so we don't really need another way to do that:
And there's also already a way dynamically load CSS (using media queries, even):