Posted By

serialk89 on 11/24/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rober


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


 / Published in: JavaScript
 

  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  

You need to login to post a comment.