Skip to content
Sign upLog in
← Back to Community

Javascript console output not shown after navigating away from index.html

Profile icon
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?
Screen Shot 2021-02-19 at 11.15.21 AM

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

Yeah, that's a repl.it bug.

You can also use the native browser console.

Click this:

image

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

and there you have it!

image

Profile icon
MillerSteve

@Coder100
Thanks! That's a good workaround.

Profile icon
Coder100

np :)

@MillerSteve

Profile icon
xxpertHacker