Hello guys, i was working on mobile hotspot page for this week. I just finished that today and tested many many times. It’s working fine. I found 2 solutions to recognize mobile phone from hotspot page.
First : We can recognize by screen width. Screen width of most mobile phone is smaller than 600 or 500px(actually 480px). We can insert some javascript row in our login.html file.
function detectDevice()
{
if(screen.width<600)
document.location=“mobileLogin.html”;
else
document.location=“otherLogin.html”;
}
Second : We can know who connecting by mobile or other devices by user agent contained in http request. Example:
function detectDevice()
{
var mobile=(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if(mobile)
document.location=“mobileLogin.html”;
else
document.location=“otherLogin.html”;
}