Dectectando Mobile Safari


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.