Javascript


#1

Hello, I’m new to all of this.
I learn javascript at school and I found Atom to work on javascript at home.
Can somebody guide me on how to set up Atom for javascript because I have no idea what to do and
all I see right now is just a text field (no result window and whatever). So yeah if anyone can help me I’d be happy!


#2

Hello and welcome
I’m quite new too but as far I know JavaScript works together with html so you need to create a html file with the sections (head, body, divs) then you can fill and play with then in JavaScript, either in a script tag or in a separate file loaded in html.

To test it you need to open the .html in a browser (try avoiding internet explorer ) and see of it works. In chrome you can press f12 to see what you would call “result window” and some tools. But testing lines of js in the console is quite worthless.

If you want to learn programming easily try python instead with spider editor https://sourceforge.net/projects/winpython/files/

And whatever you decide, check for tutorials on the web you find a lot like w3school.com and openclassroom.com

Wish you good luck

If ever you abslutly want to start js save this in a file.html , open it , and you can start from here
A better one as soon I got my computer internet back

<!--doctype and head you will need to check on the
Web I don't remember-->
<body>
  <div>
    <div onclick="javascript:countClick()"
       style="background-color:blue; 
                   color:white;
                   font-size:25px;">
       Oh yes click on me!
    </div><br>
    <div id="clicCount">
       What you wait?
    </div>
  </div>
  <script>
var count=0;//this stores the actual count
function countClick() {//called on click
  count+=1;//adds one to counter
  document.getElementById("clicCount")//gets the div
      .innerHTML = String(count)+" little pigs";//replace text in div
};// might need correction did it on phone
  </script>
</body>

#3

And about your question cuz I got a little out-topic finalement
Atoms needs no setting for JavaScript if you save your file .html or .js it will recognize and color the text and you can choose manually with ctrl+shift+L


#4

The script package allows for easy running of most sorts of code, JS included. In terms of testing short bits of code, I’d actually recommend online tools like Codepen and JSFiddle. Atom is great for composing a whole site and putting everything together, but those two tools allow for very fast and easy development of discrete bits of code, which you can then plug into your project in Atom.