I am using the following HTML fragment to load a different stylesheet for smartphones:
media="only screen and (min-device-width: 4801x)"
media="only screen and (max-device-width: 480px)"
I would like to disable a certain javascript script for smartphone users as well. Is that possible? I don’t think i can do:
<script media="only screen and (max-device-width: 480px)" t ype="text/javascript" src=""/>
Thanks
You can detect the screen resolution in javascript and then change script execution based on the resolution. But the javascript file will still be loaded. To detect the screen size:
http://www.pageresource.com/jscript/jscreen.htm