I am new in Atom and javascript.
I did download Atom an successfully launch him. But I not have any knowledge how start to work in it?
That what I see and try type in window:
It is no similar on code and I have not see a "run" or any other buttons for launch that code.
How to code and start javascript project in Atom or any other IDE?
There are a few things that I feel like I need to clarify! Javascript is a language made for the web so it generally works with HTML and CSS that is why most tutorials include HTML and CSS with the Javascript. Thus, unlike Java, Python, VB.NET there isn't a button to click and JS code runs, you have to include it into an HTML file like how @user3538203 showed.
Now I will add a few steps to start a JS program.
Note: There are ways to make JS work in the console or as an application but these will require more knowledge about JS and you will need to install NodeJS or some special package as @user3538203 showed.
I am not sure if you can do that in Atom by default. I always just use the command line for JS with Atom/Aptana etc. if i'm using grunt, gulp, npm etc.
In order to do that you have 2 options:
<!DOCTYPE html> <html> <body> <h2>External JavaScript</h2> <p id="demo">A Paragraph.</p> <button type="button" onclick="myFunction()">Try it</button> <p>(myFunction is stored in an external file called "myScript.js")</p> <script src="myScript.js"></script> </body> </html>
And then open the HTML file using Safari/Chrome/Firefox
The solution
filename.js
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.