Home > Software design >  window.location.replace returns incorrect link
window.location.replace returns incorrect link

Time:05-09

I use window.location.replace(qrMessage) in my Django project, but it add the current page's URL before qrMessage into the searching page's URL and can't open it. Why does it happen and how can I avoid this?

CodePudding user response:

Link to the original poster @iPzard - answer

I think you're missing the "http" or "https" part. Have you tried the following?

window.location.href = "https://www.example.com/test";

or

window.location.href = "http://www.example.com/test";
  • Related