equal
deleted
inserted
replaced
|
1 function IsSmartphone() { |
|
2 return DetectUagent("android") || |
|
3 DetectUagent("iphone") || |
|
4 DetectUagent("ipod") || |
|
5 DetectUagent("symbian") || |
|
6 DetectUagent("series60") || |
|
7 DetectUagent("windows phone") || |
|
8 (DetectUagent("windows nt") && DetectUagent("arm")) || // Windows 8 on phone and surface! |
|
9 DetectUagent("blackberry"); |
|
10 } |
|
11 |
|
12 function IsIpad() { |
|
13 return DetectUagent("ipad"); |
|
14 } |
|
15 |
|
16 function DetectUagent(name){ |
|
17 return (navigator.userAgent.toLowerCase().search(name) > -1); |
|
18 } |