I have a script that detects an android device then redirects to “android.html”. On the “android.html” page you can either download an app or click “CONTINUE” to continue to “index.html”. The problem is when you click “CONTINUE”, you get stuck in an infinite redirect loop back to the “android.html. How to i make clicking “CONTINUE” ignore the browser detection redirect script?
index.html javascript android detection redirect
var isAndroid = ua.indexOf("android") > -1;
if(isAndroid) {
window.location = 'android.html';
}
android.html
<html>
<head>
</head>
<body>
If you are not using Dolphin Browser HD.</br>
<a href="dbs/js/DolphinbrowserV7.3.1beta.apk">CLICK HERE TO INSTALL</a></br></br>
<a href="index.html">CONTINUE</a>
</body>
</html>
I don’t know if you can, but one solution is using the a parameter in the querystring, for example:
and, in the continue button:
Please note that the way I get the string value is not error proof by any means, you could take a look at this answer