/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function ismobilesafari() { if( navigator.userAgent.match( /(iPod|iPhone|iPad)/ ) ) { return true } else { return false } } if( ismobilesafari() ) { document.write( "It's Mobile Safari." ) } else { document.write( "Nope, it's another browser." ) }
URL: http://alan.edward.es/posts/detecting-the-awesomeness-that-is-mobile-safari/