Redirect Mobile Browsers on JavaScript - Simply from one page to another
I want to use the JavaScript redirect function on mobile browsers. Not to
redirect IF it is a mobile browser -- the page is already optimized for
mobile to begin with. Just a simple redirect from one page to another.
Here is my code:
var url = "http://---.---.net/index.php?site=" + id;
location.replace(url)
Also tried:
var url = "http://---.---.net/index.php?site=" + id;
window.location.href = url;
These both work on Desktop browsers, but not my Android HTC device. I have
tried both the stock browser and Chrome and no redirect. I don't have
access to an iOS device so not sure if that will work either for that.
No comments:
Post a Comment