Getting Started
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:
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:
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
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
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:
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.
Good stuff!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks man, very much appreciated!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit