Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
JavaScript
function isMobile() {
	
	var index = navigator.appVersion.indexOf("Mobile");
	return (index > -1);
}
function setStyleMobile() {
	
	document.write("<style>body { font-size: 3em; } </style>");
}
function makeFontTripleSize() {
	document.write("<style>body { font-size: 5em; } </style>");
}


if (isMobile()) {
        setStyleMobile();
	document.write("Mobile browser");
}
else {
        makeFontTripleSize();
	document.write("Regular browser");
}

Hi,

I have the code to differentiate the mobile users and normal desktop users but i don`t want to increase the font size i want to redirect them to two different URL`s Can you have any suggestions. Any help would be appreciated.
Posted
Updated 12-Oct-11 17:30pm
v2
Comments
Sergey Alexandrovich Kryukov 12-Oct-11 20:30pm    
Why putting all this code except isMobile()? If you want to ask about redirection, ask about redirection...
--SA

1 solution

Try using window.location for redirect.
JavaScript
window.location.assign('http://www.abc.com')

or
JavaScript
window.location = 'http://www.abc.com'


Google[^] for more.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900