0

I want redirect a user from https://app.salonized.com/c/5304/dashboard (the page after logging in) to this page https://app.salonized.com/franchise/reports/overview using JavaScript. I tried some redirects but I lack the knowledge to get this done properly.

I tried this method but I think I'm doing it wrong:

if
window.location. = "https://app.salonized.com/mobile"
else 
window.location.href = "https://app.salonized.com/franchise/reports/overview"
2
  • You haven't added the condition in your if statement Commented Oct 16, 2019 at 13:49
  • @KaranKiri Im really starting with javascript, could you maybe demonstrate how I do this ? Commented Oct 16, 2019 at 13:52

1 Answer 1

1

Just need some proper synax.

'=' for setting and use '===' for comparing

if(window.location.href === "https://app.salonized.com/mobile"){
    window.location.href = "https://app.salonized.com/franchise/reports/overview";
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.