Ask coding questions

← Back to all posts
Javascript console output not shown after navigating away from index.html
MillerSteve

Hello,

I have an HTML/CSS/JS project that for some reason won't show output in the console via console.log() once I navigate away from the main page (index.html). I'm showing the behavior in the linked repl. Clicking the buttons on either page invoke "handleButton()" which simply calls console.log("Button Pressed"). It works on the main page, but does nothing on page2. Even if I invoke console.log() from within the console itself, I still don't see the output once I navigate from the first page. You can see this in the console of the attached image. The first call to console.log() is called from the main page and prints "Hi". The second call to console.log() is made after navigating to another page and prints nothing. Does anyone know a way around this?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
KateFractal1
MillerSteve
Comments
hotnewtop
Coder100

Yeah, that's a repl.it bug.

You can also use the native browser console.

Click this:

then do ctrl + shift + j (or cmd if you mac)

and there you have it!

MillerSteve

@Coder100 Thanks! That's a good workaround.

Coder100
xxpertHacker