Re:Responsive JavaScript
by wwweston on Tuesday February 11, 2014 @03:23PM
(#7220143)
I can see the appeal, but I wonder if this might not be better accomplished with an HTTP header that would explicitly give the viewport dimensions and/or some information about the connection type/speed.
[ Parent
| on HN ]
Viewports can change in size once the page has loaded. A Connection-Quality: GPRS, 512kbps; header would be nice. But then you still get an issue when phones must report or the user toggles on WiFi as soon as they see a few bad (low bitrate) assets.
Re:Responsive JavaScript
by hayksaakian on Tuesday February 11, 2014 @06:46PM
(#7221448)
Its more simple than that, imagine I rotate my screen.
Do now need to send every possible view port with the original header?
Yeah, suggesting viewport dimensions was a lazily considered and unfortunate choice on my part. Screen dimensions -- probably in particular the larger device width -- would be better, and now that pixel density is an issue, that as well.
That's the thrust behind the Client Hints proposal: https://github.com/igrigorik/http-client-hints