Question

Determine page type in javascript?


Badge +18

Hi Team!

Is there a method I can use in javascript to determine if a page is Mobile or Desktop?


This topic has been closed for comments

2 replies

Badge +13

You can check whether “skuid.mobile” is defined — if it is, you’re in Mobile, otherwise in Desktop, e.g.

var isMobile = !!skuid.mobile;
if (isMobile) {

}

Badge +18

Nice. Thanks!