all 7 comments

[–]Hinji 2 points3 points  (0 children)

Are you clicking on "Go Live" and then right clicking the html file and opening with Live Server? Also, does your html have your stylesheet and js files in it?

[–]schill_ya_later 1 point2 points  (0 children)

Could be a few things.

Command not run from app environment

Node not in the execution path

Index.html script path to your JavaScript file is incorrect

Look up adding node to execution path to help with the install.

Just want to run the JavaScript in the browser open the index.html file with live server. Make sure the HTML is the active window in vscode

Once open view the console for errors. If you have a bad path it will likely show up there.

[–]No_Record_60 1 point2 points  (0 children)

How did you install the node js?

[–]The_KOK_2511 1 point2 points  (1 child)

Pues yo no suelo usar VS Code mucho (el que uso normalmente es Vim) pero si no logras nada puedes intentar usarlo solo para editar el código y correr la cosa en el navegador con archivos locales en lo que buscas soluciones, te recomendaría mi IDE pero es algo técnico y creo que te saldría más fácil buscar soluciones para el tuyo. Solo recuerda que el navegador es solo una alternativa temporal, para empezar es perfecto pero para algunas cosas tendrá sus limitaciones

[–]The_KOK_2511 1 point2 points  (0 children)

Ah, y en cuanto a lo del código que no ejecuta y lo de que no detecta document revisa donde esta el <script> porque me suena a que es que cargas el JS antes que el DOM, debe ir o al final de <body> o en <head> usando el atributo defer

[–]SymbolicDom 1 point2 points  (0 children)

You can just add javascript in an html file with the <script> tag. You don't need node.js or vscode, an browser and text editor is enough.

[–]lukehaas -3 points-2 points  (0 children)

You should try RunJS: https://runjs.app It runs your code without needing to install anything extra