0

I'm building a simple responsive page. The desktop version includes some resource intensive elements. Rather than simply hide these elements on the mobile site, I would like to choose what content to load and not to load dependant on the device. What is the best way to do that?

Luke Bailey
  • 158
  • 2
  • 10

1 Answers1

0

Media queries and/or feature detection with clever javascript/css class checking will accomplish your goals. [More info]

For example, using javascript to check if the window is narrow and then not loading that heavy duty ajax load with the video and all the gizmos.

Also check out the many articles on progressive enhancement, like this one or this one

You want to avoid user agent sniffing. But if you can't, checkout one of the many implementations of ua-parser

Anthony Hatzopoulos
  • 9,929
  • 2
  • 35
  • 56