The language we will be learning is called JavaScript. It is primarily used to add interactive functionality to web pages, but it's now also starting to be used for other things, including robotics. We will start by learning to create web pages, using HTML (HypterText Markup Language) and then learn to use JavaScript by putting JavaScript in web pages that you create. This page itself is a good first example of a web page.
There are many resources on the web for learning JavaScript, so you can do fine in this course without a textbook. But having a book to follow and a reference source you can carry and page through can be useful. I can suggest two. The first is very complete:
Sams Teach Yourself HTML, CSS and JavaScript All in OneThe second covers just JavaScript. It's the book I've used in the past before Meloni's book became available:
by Julie C. Meloni (2015, Pearson Education, 2nd Edition)
Sams Teach Yourself JavaScript in 24 HoursIt may help you to know that the 24 hours means 24 lessons, each about an hour long; it doesn't mean that you can stay up all night and know how to write programs in JavaScript the next day.
by Michael Moncur (2002, Sams Publishing, any edition)
It has been a long-standing convention in computer operating systems to use an "extention" to a file name to indicate what's in the file. Image files end in ".jpg" or ".png" while text files end in ".txt". Web pages end in ".html". And when you double-click on the file to open it the application chosen to do the job matches the extension. The problem is, Windows and Mac both try to hide the file extension from the user. So you'll need to make some adjustments to make the file extensions visible.
To make file extensions visible in Windows open the Control Panel and go to "Appearance & Personalization". Select "Folder options" and press the "View" tab. Then uncheck the box marked "hide file extensions".
After this you will notice file extensions on all your files. PDF documents will end in ".pdf" and Microsoft Word documents will end in ".doc" or ".docx". This is a useful distinction, but it may be confusing at first. You'll get used to it.
On the Mac you have to tell TextEdit to not put the ".txt" file extension on all text files. You'll be editing HTML files as text files, but they should have the ".html" extension.
To do this, open TextEdit and select "Preferences". With the "New Document" tab selected, set the Format for a new document to be "Plain text" (not rich text). (Optionally, you can also set the window size to be 80×48, and select other options.) Then press the "Open and Save" tab and do the following:
One thing you should be aware of is that Unix implements line endings differently, so if you copy your files to a Mac or Windows computer there won't be any line endings. You can fix this by running the command dos-to-unix once while editing the file.