Is it possible to reload a page in sololearn with javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is it possible to reload a page in sololearn with javascript?

On the internet, I found that we can reload a page using document.location.reload(true). It works fine on the internet but not in sololearn. Here is the example: https://code.sololearn.com/WA9A98a83a24 in sololearn,when I click the button, the whole content becomes invisible(at least in sololearn web. Don't know about the mobile app).So is there any way to reload a page in sololearn using js? Thanks in advance.

13th Jun 2021, 12:24 PM
The future is now thanks to science
The future is now thanks to science - avatar
3 Answers
+ 1
dozule Thank you very much for the link .That was quite helpful.
13th Jun 2021, 3:24 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 1
using js you could read your document source at start (throug DOM), save it in a variable and document.write() it in a new opened document that you need to close after... however, it's quite tricky, as you must at least remove the js script parts (because that's only refresh the html/css part... the js remain living in memory) and at worst adapt your js to be able to reset its execution in the starting state ^^ from my point of view, if even possible, there's almost quite no chance that it worst the pain to do so ;P
13th Jun 2021, 4:41 PM
visph
visph - avatar