Conditionally Load Javascript Based on Media Query
Best practice for a long time has been to load your javascript at the end of the document to improve website performance, however in todays world of mobile devices we need an even faster solution.
@media all and (max-width: 900px) { // styles } if (document.documentElement.clientWidth < 900) { // scripts }