Is it possible to redirect further from the page where JavaScript determines the browser UA?
I'd like to sort the pages separately between non-compatible mobile phones and compatible mobile phones.
1. Jump to the page and first determine the UA
Redirect in 2.0 seconds (this way if A or this way if B)
Is it impossible without clicking?
I'm sorry that I can't understand your question.
Yes, just skip to window.location.href
.(Configure redirect to avoid loops.)
For example, to fly to various places on ja.stackoverflow.com
varua=navigator.userAgent;
if(ua.indexOf('iPhone')>0||ua.indexOf('iPod')>0||ua.indexOf('Android')>0&ua.indexOf('Mobile')>0){
// When using a smartphone
window.location.href="https://ja.stackoverflow.com/questions";
} else if(ua.indexOf('iPad')>0||ua.indexOf('Android')>0){
// When using a tablet
window.location.href="https://ja.stackoverflow.com/tags";
} else {
//?
window.location.href="https://ja.stackoverflow.com";
}
© 2024 OneMinuteCode. All rights reserved.