JavaScript
Broadcasting 450: Advanced Online Journalism
Felix Burgos
What is JavaScript?
Dynamic computer programming language
A programming language defines the computer instructions which
are used to write programs that perform some task, e.g.
composing a web page.
Originally developed by Brendan Eich who worked for Netscape
Communications Corporation
Currently used as part of a web browsers to alter how content
interacts on a web page & change the document content that a
webpage display
Also used in server-side programming to create both desktop and
mobile applications
JavaScript in journalism
Why am I studying JavaScript? How can JavaScript enhance
or help online journalism?
JavaScript can be used to enhance stories
JavaScript can be used to extract information for stories
JavaScript can be used as a way to dive into further
programming languages
Examples of JavaScript in Journalism
Interactive: Before and after the Highway
530 mudslide
China Still Dominates, but some
Manufacturers Look Elsewhere
Drought and Deluge in the Lower 48
JavaScript basics
Prototype-based programming
Inheritance happens via cloning
Coding happens in the <script type=text/javascript> </script>
tags
Var (number, word or sentence)
Strings & String concatenation
Alerts and Prompts
If and Else statements/Functions
Some more JavaScript
fundamentals
Numbers, Boolean, Text
For loops / While loops
Operators
Arrays
Arguments
Forms and Validation
Document Object Model (DOM)
Document
Root
element
<html>
Element
<h2>
Element
<h1>
Text
Creating a
blog
Text
Felixs Site
Attribute
<href>
JavaScript libraries
jQuery
Prototype
MooTools
So you want to learn JavaScript
All you need is a text editor and a web browser!
Freeware coding software
Brackets (Win/Mac OSX)
NetBeans (Win/Mac OSX/Linux)
W3Schools, http://code.org, http://codeacademy.com,
F12 in Google Chrome and Mozilla Firefox opens up Developer
Tools
Developer Tools..USE IT!!
Looking ahead to the future
Many jobs now prefer to hire candidates who have some
experience with code and web development
Writing code requires logical thinking; it helps exercise the
brain all while picking up a new skillset
Many schools, including middle and high school are now
introducing coding classes, and some of these schools are
making these classes a requirement for graduation
Reading, Writing, Arithmetic, and Lately, Coding
Coding is here to stay; learn it or get left behind!