Detecting if under a mobile webbrowser
Posted: Wed Jan 13, 2016 11:04 am
I've found a code to detect mobile web-browsers, but after an adaptation, it doesn't seems to works on SB.
Can you take a look ?
I would like the event to be bind only if i'm not under a mobile, but my var "isMobile" always stay to 0.
Can you take a look ?
I would like the event to be bind only if i'm not under a mobile, but my var "isMobile" always stay to 0.
Code: Select all
isMobile.i = 0
! if(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) {
! v_isMobile = 1;
! }
If isMobile = 0
BindEvent(#PB_Event_SizeWindow, @SizeWindowHandler())
EndIf