title: What's the best practice when optimizing for a responsive mobile version of a website?
body: <p>I want to exclude a number of items on my website when viewing it on a screen with a small screen resolution so I'm using CSS media queries to hide the items. But a Facebook Like box, for example, is still loaded in the background - a number of javascripts and css files - how do I prevent them from being loaded in order to decrease the page load time?</p>
  
  <p>Right now I'm using PHP to check user agent and then simply exclude the code, but I wonder if that is the best way really. Over time I will have to change the PHP when new devices are introduced for instance. Is a script like Modernizr an option here?</p>