So i have recently started using codecademy to learn code. I used notepad++ before and I still like to use it as a way to write up my code. So when I learn something new here I usally mess around with it in notepad++ but then i soon realized that common functions used here do not work in the real world. Like console.log does not print anything in notepad++, but instead document.write is used. So i don't understand why we're being taught false code, can anyone explain why this is? Why can't the devleopers or creaters just change console.log to document.write?
P.S what the heck is DOM
I don't recall
document.write being taught here. That would imply a web page which we do not have in these lessons. Not until we get to the jQuery track do we write for that medium.
We should not confuse
console.log() with production coding. It is NOT used in a page facing the web (or a normal browser window). It is only used in the terminal environment we are presently in. As you will find out eventually,
document.write is quite outdated, as well, so we won't be using it much, ever. There are other ways, but going into them now would just be a distraction.
HTML => document structure CSS => presentation JS => behavior
Nothing helps with building our vocabulary better than reading. Lots of reading. Like learning anything, very little sticks at first, so repetition is essential, whether reading or doing. Search for 'document object model` and begin going through the search results. You'll learn more from that than having me give you a pared down explanation.
Thanks for the answer man/woman
P.S: You should become a philosopher or something, your words have deep meaning!
You can write code in Notepad++, save it, and copy it to the command line and enter it into memory. If the code is all functions, then it will need to be invoked. If it is in command form it will execute immediately. Function code remains in memory, as well as any global variables created by your code. This is what makes it an ideal debugging environment.
document.write is considered obtrusive since it must appear inline in the HTML source. That's why it has gone the way of the Dodo. We have better ways to inject content into the DOM from within our external script. Modern standards abhor script in HTML.
I really need to search those terms up, like you suggested earlier. So document.write has been tabooed due to its obtrusive ways. Thanks again for the answers. I wont bug you anymore
No problem. That's what I'm here for. Ask anything you like. Never 'bugs' me, ever. Better you are informed, or guided to answers you seek.