Skip to content
Advertisement

Window.location not working in Javascript

So I’m new to JS, and I wanna redirect the user to another page…

My code:

JavaScript

I know this is not a secure way to auth, but relax it’s just a portfolio project

Advertisement

Answer

You should append the ‘//’ after window.location.protocol which mentioned by @Vasan.

Using ES6 template strings would make it clear.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement