chrome developer console
chrome devtools extension
chrome developer mode
how to enable developer tools in chrome
chrome developer edition
chrome developer tools shortcut
chrome developer tools tutorial pdf
To clarify - you are loading a .js file in the browser which is what is displaying in chrome (the content of that file).
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <script src="main.js"></script> </head> <body> </body> </html>
In order to see your html content on browser you should load .html file instead of loading .js file
<!DOCTYPE html> <html> <head> </head> <body> <script> console.log("good morning"); alert("good morning"); </script> </body> </html>
<!DOCTYPE html> <html> <head> </head> <body> <script src="nameOfFile.js"></script> </body> </html>
- Navigating directly to a
.jsfile in a browser will not execute it; it will just show the raw text for you to view. If you want to run it in a browser, create a simple HTML page with a
- Please don't post pictures of your code, post the actual text of the code.
- @ScottMarcus In this case I'd argue the screenshot is better. The issue doesn't relate to the code or debugging it, but rather software and/or environment behavior.
- @TylerRoper A screenshot of what the browser is displaying, yes. But, not of the code, which is what my comment was mentioning.
scriptthen it would not even throw an error.
- Thank you @t.niese, yes, to be strict, and suposing you have a global
scriptvariable, it would be valid. I was referring to this example, in which no global variable was set, and the intention of
script.jswas to load the script, not to execute it, and it was wrong. I supose I could explain it better.
- Thank you Javier
- Thank you @Ritu as soon as I read your explanation I understood my error.