DETECTAR SI SE ENTRA A LA PLAGINA POR IPHONE, ANDRIOD, JAVASCRIPT


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



Copy this code and paste it in your HTML
  1. var agent = navigator.userAgent.toLowerCase();
  2. var iphone = (agent.indexOf('iphone')!=-1);
  3. var android = (agent.indexOf('android')!=-1);
  4. var blackberry = (agent.indexOf('blackberry')!=-1);
  5. var ipad = (agent.indexOf('ipad')!=-1);
  6. if (iphone) {
  7. document.location.href="http://envivo.13.cl/iphone";
  8. }
  9.  
  10. if (android) {
  11. document.location.href="http://envivo.13.cl/android";
  12. }
  13.  
  14. if (blackberry) {
  15. document.location.href="http://envivo.13.cl/blackberry";
  16. }
  17.  
  18. if (ipad) {
  19. //document.location.href="http://envivo.13.cl/ipad";
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.