Search code examples
javascriptmedia-queriesresponsive-designprogress-4glescript

Responsive Design - How not to load certain scripts?


Have finally got a responsive site working (of a fashion). What I want to do now is reduce what scripts are loaded on the mobile devices, so that they load faster. The scripts are redundant on the mobiles so it seems a good place to start.

Is there a way of only loading certain scripts depending on the device?

The site is a 3rd party e-commerce site, which doesn't allow different versions of the page for different devices. The server-side language is progress' e-script (of which I know nothing).

Any help would be much appreciated!!


Solution

  • Modernizr does feature detection and can conditionally load resources. It's more or less standard for this kind of thing unless you roll out your own.