How to get console.log to work?


#1

I can not get console.log() to fire up unlike alert (), any ideas how to make it work? I have my html file linked to js file, all seems good except the command console.log () does not show anything!!???


#2

This appears to be a general JavaScript question, not an Atom question, and in order to answer it we would need to be able to see your code and potentially would need more information about how you’re trying to use the console.

Are you trying to get console.log() output from a page displayed through a browser preview package in Atom?


#3

Thanks DamnedScholar for the reply. I am quite a beginner, but I think you know what I mean. Since I use Atom at the moment as my editor, that’s why I joined this page. I have my html page with the pre-script code:

Web Course ----------------- my js file contains this:

var c= 44;
var p = 90;
console.log§;
console.log(‘side’);
alert §;


obviously it is a basic program, but it is for testing. So on the chrome page nothing appears other than the small window showing the alert function but nothing comes out of console.log???


#4

I can’t see anything for the HTML code. You need to wrap your code segments in tags so that the forum knows what they are (you can highlight a block of text and press the </> button above the editor).


#5
Web Course

#6
Web Course

#7

Or you can use one of the many file sharing or text sharing sites. Codepen, Dropbox, Pastebin, a gist, etc.


#8


#9

I don’t know what to tell you. It works perfectly for me in Chrome.

This is not a complex project, but in the future, I would advise you to do everything you can to make it easy for people who might want to help you to replicate your situation. That means providing as much detail as possible and also complete and unformatted code files.