To check whether the page is acceded from mobile device or browser please use below script
//*******************************Jquery For Mobile Device Start ************************************/
$(document).ready(function(){
var mobile = (/iphone|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile)
{
alert("MOBILE DEVICE!!");
//Retriev Browser URL
var url = window.location.pathname;
//Get Page Name From browser URL with extenstion
var filename = url.substring(url.lastIndexOf('/')+1);
}
else
{
alert("NOT A MOBILE DEVICE!!");
}
});
//*******************************Jquery For Mobile Device End************************************/
Lie Jquery file URL:
https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js