Redirecting to another web page does not work in mobile

Hi,
I am doing a web page, and when testing it on mobile, it does not redirect successfully (from dropdown menu which is in “tanssityylit”). I found the hint to redirect from here:
https://www.w3schools.com/howto/howto_js_redirect_webpage.asp

But when I test it from my laptop (instead of smart phone), it redirects properly without a problem.

I am doing a school assignment, so the teacher should find my project as a link from a public space.

Any hints how to make it work and why it does not work right now?

Here is the front page:
https://codepen.io/CoderInCodeCamp/pen/WPWrXE

@CoderInFreeCodeCamp

Try 
window.location='..............';
instead of location.replace

or 

make use of anchor tag directly as follows:
<a href="............" >Link</a>

1 Like

Ok thanks :sunny: That seems to work.

location.assign()

The location.assign() method loads a new document in the browser window.

window.location.assign("http://www.w3.org");

When to use assign() and replace() method

The difference between assign() and replace() method is that the location.replace() method delete the current URL from document history, so it is unable to navigate back to the original document. You can’t use the browsers “Back” button in this case. If you want to avoid this situation, you should use location.assign() method, because it is load a new Document in browser. More on…url redirect