Line makes the other not work

parent.ports.reset();
parent.ports.document.getElementById('overview').innerHTML = name + " @" + IP;

reset() line causes the line after it not work. I know this because I commented it out and now it works. I’m pretty tired and I have no idea how this can possibly be happening.

Hi roberto, welcome!

What libraries are you working with (Discord?) and what is parent.ports in this context?

My one idea is that if parent.ports.reset() literally resets the state of the ports object then maybe it doesn’t have a document property afterwards. In between the two lines, you could console.log(parent.ports);

So basically, this is a static website made up of frames (I know they are deprecated but they suit me too well) and parent.ports.reset() is telling to call the function reset() I wrote in the frame “ports.html”

function reset() {
  document.getElementById('p80').style.backgroundColor = "#511713";
  document.getElementById('p22').style.backgroundColor = "#511713";
  document.getElementById('p80').style.backgroundColor = "#511713";
}

Makes a bunch of block red again (this is a game)

https://hacknet-online.glitch.me/ website

This has happened again here:
alert(1)
parent.mainMenu();
I had to place the alert(1) above as otherwise it wouldn’t run