The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Conditional Script Loading Reply To: Conditional Script Loading


Shikkediel, that was my first thought as well, but kwerty specifically said “mobile phones”. Simply doing a screen size check will not load the js files on a desktop browser if scaled below, say 500px (normal px width to check for), as you probably already know. I guess it really depends on what they’re trying to do. That’s the only reason I suggested browser sniffing. Otherwise, yeah, it’s much easier to just check screen size.