Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the ad-inserter domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/blog.webeats.it/httpdocs/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the cookie-law-info domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/blog.webeats.it/httpdocs/wp-includes/functions.php on line 6114
Device.js: riconoscere facilmente os, device ed orientamento

device.js di Matthew Hudson ha scritto una piccola libreria JavaScript per gestire tipologia device, orientamento e OS tramite CSS o JavaScript

Segui il progetto di device.js su GitHub: https://github.com/matthewhudson/device.js

Device supportati:
iOS: iPhone, iPod, iPadAndroid: Phones & Tablets
Blackberry: Phones & Tablets
Windows: Phones & Tablets
Firefox OS: Phones & Tablets

device.js

Come già detto, i controlli possono avvenire tramite CSS o JS.
Tramite l’uso delle classi, device.js aggiunge al tag <html> delle classi relative a OS, device e orientamento. Ad esempio visitando con un iPhone il sito, nel tag <html> troveremo:

<html lang="en" class="ios iphone mobile portrait">

Mentre da un desktop, ad esempio dal mio iMac troveremo:

<html lang="en" class="desktop landscape">

Più esempi e spiegazioni potremo trovarli sulla pagina ufficiale GitHub di device.js, mentre per vedere un esempio segui questo link