I need to redirect a javascript file to a given URI specified by the user.
So a quick example of how I do this:
function redirect(uri) { if(navigator.userAgent.match(/Android/i)) { document.location.href=uri; } window.location.replace(uri); }
This is great for everyone except Android devices. iOS and all modern Webbrowsers support window.location.replace (...), however Android devices do not.
But if I try to redirect this function now, say, " http://www.google.com ", Android devices cannot actually be redirected to this url.
Now am I just stupid here or is there another problem?
Sincerly
ps the redirection function is called as a callback to the sent XML request, but this should not be a problem at all.
source share