HTML5 mobile boilerplate includes a Javascript file called helper.js which improves the UX on mobile devices. I want to include this file in all my responsive apps but it bugs me that I'm also forcing desktop users to download it.

How do people handle this? Why doesn't HTML5Boilerplate (the desktop version) include it even though most websites intended for use on mobile devices can benefit from it.

有帮助吗?

解决方案

You could detect user agent screen width and load it dynamically.

Although at 8k (minified), it might make more sense to include it by default if you think your app will reach a worthwhile percentage of mobile users.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top