+ 2
How to change window location in JS
For instance, I have this code https://code.sololearn.com/WSOxiOh4MTRO/?ref=app In that, I used location.href, but it didn't worked. Also, I'd tried window.open("https://www.sololearn.com", "_self"); How to do it?
3 ответов
+ 2
code killer > I've tried the replace, and it doesn't works. Maybe SoloLearn is intentionally blocking these actions, as it seems to work on normal browsers.
Anyways, I've fixed it by using a full screen <iframe> tag.
+ 1
assign("https://www.example.com"); // Replaces the location of the current window with the new one. window. location. replace("https://www.example.com"); // Sets the location of the current window itself.
+ 1
Good job bro keep it up!