JavaScript Programming Pt1 (Getting Started)

in programming-trail •  8 years ago  (edited)

Getting Started



images.jpg
Source

Alright firstly what is needed to get started:

Any text editor, some may prefer one with syntax colour coding in which case I recommend Sublime Text 2.
Notepad ++
Notepad
Gedit
Nano
Any of these will do the trick, we really just need to be able to save raw txt without extra characters being added.

Next we need a browser to be able to view the code we have written.
Chrome
Chromium
Firefox
Opera
Safari
Any standard internet browser will do, some may have funkiness dealing with modern Javascript so I recommend firefox or chrome.

Now we have those, lets have some fun!

Open up your text editor and create a file on your desktop named HelloWorld.html or anything you like really.

Now lets add the following to our file:

one.png

Alright this stuff is fairly innocuous, I am sure you have at least seen some basic html tags but here we tell the browser that our file is an html file, now lets open up our file in our browser:

two.png

Pretty boring right? Well there are some things here that aren't immediately apparent so lets open up our developer console as well: With firefox > Tools > Web Developer > Web Console

three.png

Awesome lets swap back over to our text editor and do some stuff, everything we do for now will be between the open script tag and closing /script tag

four.png

You will notice that I have added a meta charset and a media print tag this is simply to clean up some complaints from firefox.

The fun thing is console.log, this allows us to log information to our developer console, go ahead and save and refresh the file in your browser and you should see this:

five.png

My First Words!!!
Excellent console.log is used for numerous things such as debugging as well as communicating information.

This ends our first lesson play around with console logging different information and join me next time when we learn more about Javascript programming.

You can find Part Two here.

Thank you for your time and attention.

Logomakr_6m9Y20.png

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Good stuff!

Thanks man, very much appreciated!