Wednesday, 14 May 2014

how get the tablet device by javascript


Some times you may detect device by javascript.

if you want to detect tablet device by javascript code you will have to put the following code in script

var isMobile = window.matchMedia("(min-width: 760px) and (max-width: 959px)");

if(isMobile.matches)
{
   alert "i am in tablet";
}

same way for phone or ipad


No comments:

Post a Comment