Posted By

thiagotargino on 08/26/11


Tagged

safari ios


Versions (?)

Dectectando Mobile Safari


 / Published in: JavaScript
 

URL: http://alan.edward.es/posts/detecting-the-awesomeness-that-is-mobile-safari/

  1. function ismobilesafari() {
  2. if( navigator.userAgent.match( /(iPod|iPhone|iPad)/ ) ) {
  3. return true
  4. } else {
  5. return false
  6. }
  7. }
  8. if( ismobilesafari() ) {
  9. document.write( "It's Mobile Safari." )
  10. } else {
  11. document.write( "Nope, it's another browser." )
  12. }

Report this snippet  

You need to login to post a comment.