Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js if mobile browser

// credit to Timothy Huang for this regex test: 
// https://dev.to/timhuang/a-simple-way-to-detect-if-browser-is-on-a-mobile-device-with-javascript-44j3
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
  return true
}
else{
  return false
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: enable button jquery 
Javascript :: jquery see if element is visible 
Javascript :: jquery reload page 
Javascript :: jquery checkbox changed event 
Javascript :: get tomorrows date using moment 
Javascript :: jquery chrome console 
Javascript :: delete session javascript 
Javascript :: clear cache of node file 
Javascript :: change src of iframe jquery 
Javascript :: python json save to file 
Javascript :: how to edit a web page 
Javascript :: jquery select checked radio button value 
Javascript :: react native rotate 
Javascript :: react place div at center of page 
Javascript :: zip code regex 
Javascript :: react native position absolute center 
Javascript :: redux devtools with middleware 
Javascript :: dino game hack 
Javascript :: exclude node_modules from tree command 
Javascript :: javascript clear div 
Javascript :: angular go to route 
Javascript :: how to get last path from url in javascript 
Javascript :: format amount in javascript 
Javascript :: remove header from certain pages react navigation 
Javascript :: Javascript get random item from array 
Javascript :: remove all inline css jquery 
Javascript :: javascript check if object is empty 
Javascript :: vue 3 cdn 
Javascript :: alphabets regex js javascript 
Javascript :: how to get name array value in jquery 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =