Navigation

6/06/2014

jQuery to detect iOS

Want to display code only for iOS devices:


function isAppleDevice(){
    return (
        (navigator.userAgent.toLowerCase().indexOf("ipad") > -1) ||
        (navigator.userAgent.toLowerCase().indexOf("iphone") > -1) ||
        (navigator.userAgent.toLowerCase().indexOf("ipod") > -1)
    );
}


From jquerybyexample.com

No comments:

Post a Comment