admin管理员组文章数量:1356904
I'd like to run Javascript Code in Notepad++ without HTML.
I already tried to use NppExec (plugin) but it didn't work.
Is there another plugin that i can use?
Example Code:
var A = 1
var B = 2
var C = A + B
alert(C);
I'd like to run Javascript Code in Notepad++ without HTML.
I already tried to use NppExec (plugin) but it didn't work.
Is there another plugin that i can use?
Example Code:
var A = 1
var B = 2
var C = A + B
alert(C);
Share
Improve this question
asked Mar 4, 2017 at 17:00
Berny23Berny23
3381 gold badge4 silver badges10 bronze badges
1
- @EatPeanutButter the syntax is valid in JavaScript. However it is seen as a good practice to end all your statement with semicolons. – Abhishek Gupta Commented Mar 4, 2017 at 17:05
4 Answers
Reset to default 6To run JavaScript you need a runtime environment. This is generally provided by your browser.
You can use Node, to run javascript without browsers.
Some observations :
- You forgot to add
;
in the end of statements. As JavaScript is an interpreted language, not a piled language. So, you can put your JavaScript code inside
<script>
&</script>
tag andRun/Open
it in the browser.<script> var A = 1 var B = 2 var C = A + B alert(C); // 3 </script>
You forgot to put ; in it
You need a runtime environment to run it but it should be provided by your browser
cscript.exe filename.js
runs JS locally on a Windows with access to things like
FileSystem = new ActiveXObject("Scripting.FileSystemObject");
WshShell = new ActiveXObject("WScript.Shell");
本文标签: How can I run JavaScript in Notepad without using HTMLStack Overflow
版权声明:本文标题:How can I run JavaScript in Notepad++ without using HTML? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744058382a2583671.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论