Quelltext der Datei: http://www.michaelster.ch/jsTestFolder/jQuery/bowser-master/test/test.htm

Dateigrösse: 1020 bytes

[Anzeige ohne Zeilennummern]


 1 <!DOCTYPE html>
 2 <html lang="de">
 3 <head>
 4 
 5 <title>bowser-master browser detector</title>
 6 
 7 <meta charset="utf-8">
 8 
 9 <style>
10   html>body     { margin:2em; padding:0; font-familiy:"Lucida Sans Unicode",verdana,sans-serif; font-size:14pt !important; }
11 </style>
12 
13 <script src="test.js"></script>
14 <script src="../src/bowser.js"></script>
15 <script src="../src/useragents.js"></script>
16 
17 </head>
18 
19 <body>
20 
21 <h2>Bowser-Master: another browser detector</h2>
22 
23 <script>
24 document.write('' + bowser.name + ' ' + bowser.version + '<br><br>');
25 
26 if (bowser.mobile) {
27   document.write('Hello mobile device' + '<br><br>');
28 }
29 else if (bowser.tablet) {
30   document.write('Ciao tablet' + '<br><br>');
31 }
32 else {
33   document.write('Ola desktop OS' + '<br><br>');
34 }
35 
36 if (bowser.linux) {
37   document.write('I run <b>Linux</b>.' + '<br><br>');
38 }
39 
40 if (bowser.chrome || bowser.chromium) {
41   document.write('I belong to the <b>Chromium</b> family.');
42 }
43 
44 if (bowser.firefox) {
45   document.write('I belong to the <b>Firefox</b> family.');
46 }
47 </script>
48 
49 </body>
50 </html>
51