{"version":"1.0","type":"rich","title":"Various JavaScript methods for detecting touch/mobile devices","description":"This example presents four distinct JavaScript techniques for detecting touch or mobile devices, each demonstrated in a single file. It shows how developers can combine modern and legacy APIs to identify touchscreen capability, from checking the `ontouchstart` event and `navigator.MaxTouchPoints` to using `window.matchMedia` with `pointer: coarse` and `any-pointer: coarse` media queries. The code also includes a Modernizr-inspired approach that tests multiple vendor-prefixed queries, and a robust fallback method that checks for Pointer Events, `TouchEvent`, and event handlers. The example relies solely on native browser APIs without external libraries.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-ac9f43301f233e954955fdeac967c613?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}