in header does not log to console in edge browser", "text": "<p>Taking the learning to program plunge. I am not concerned about the best practice for where to insert javascript code into an HTML document. Rather please help me understand why the following code did not log to console in Edge browser.</p>\n\n<pre class="prettyprint"><code><head>\n <title>Layout Work</title>\n <meta lang="en" charset="utf-8">\n <link rel="stylesheet" type="text/css" href="css/normalize.css">\n <link rel="stylesheet" type="text/css" href="css/style.css">\n <script>\n var bottles = 99;\n var beerSongPartOne = " bottles of beer on the wall!";\n var beerSongPartTwo = " bottles of beer!";\n var beerSongPartThree = "take one down pass it around";\n\n while (bottles > 0) {\n console.log(bottles + beerSongPartOne);\n console.log(bottles + beerSongPartTwo);\n var bottles = bottles - 1;\n console.log(beerSongPartThree);\n console.log(bottles + beerSongPartOne);\n }\n </script>\n</head>\n</code></pre>", "answerCount": 1, "upvoteCount": 941, "dateCreated": "2022-10-19 17:25:15", "dateModified": "2022-10-21 07:18:11", "author": { "type": "Person", "name": "Lojik Overload" }, "acceptedAnswer": { "@type": "Answer", "text": "<p><strong>For Future Reference...</strong></p>\n\n<p>According to Microsoft, The EDGE console doesn't log messages without the console being open. This is 'by design'. You must open the console first for any output to be logged.</p>\n\n<p>I think this is a rather weird design choice, seeing as how all the other major browsers log events in the background. I would be interested to know why the developers decided this was a good idea. If anyone know feels free to chime in.</p>", "upvoteCount": 117, "url": "https://exchangetuts.com/scriptscript-in-header-does-not-log-to-console-in-edge-browser-1641406504112271#answer-1666373115962536", "dateCreated": "2022-10-19 18:18:11", "dateModified": "2022-10-21 07:18:11", "author": { "type": "Person", "name": "mattdevio" } } } }