Reputation: 81
I am a beginner programmer. I have a limited knowledge of javascript, but I have only worked in an IDE. I am currently following Lifehacker's programming series which teaches javascript. I have downloaded Notepad++ and have completed a program, but I am not sure of the steps to run it. In the video, the user is able to just send the program to a browser and the code runs from there.
Here is the video for reference: http://bit.ly/gUsMd3
Thanks! (note: i am a beginner to both programming and this site so any constructive criticism is welcome)
Upvotes: 7
Views: 115191
Reputation: 526
To run JavaScript with Notepad++,
window.alert("Hello world!");
Now, enclose your code with <script>
and </script>
tags.
The above code now becomes
<script>
window.alert("Hello world!");
</script>
Save the file with a .html
extension.
Now, click on Run -> Launch in Chrome
. The JavaScript code will be run in the Chrome browser.
If you modify the code, simply save the changes (Ctrl+s) in Notepad++. Then press Alt+Tab to return to Chrome. Press the Refresh button to run the changed code.
Upvotes: 3
Reputation: 17
You can also download a console plugin that would allow you to execute java scripts without leaving Notepad++. See this video for reference:
Upvotes: 0
Reputation: 394
Just save the sample code to a file, such as "example.html", and then open that file in a browser.
<html>
<script>
alert("hi");
</script>
</html>
Upvotes: 4
Reputation: 2300
Javascript does not need to be compiled, you can put it between <script>
and </script>
in a file, save it as something.html and open it in your browser.
Java needs to be compiled, but that is something completely different.
Upvotes: 19