CodePreneur Week3 - Introduction to JavaScript
-
Upload
oluwagbuyi-abimbola -
Category
Software
-
view
107 -
download
1
Transcript of CodePreneur Week3 - Introduction to JavaScript
Holla!
This is Codepreneur2016
Last week, we learned CSS, remember?
Exercisedesign a webpage with external css
Week 3.Scripts, Oil And Moving parts
Javascriptbringing life to webpages since 1995
MEET JAVASCRIPTYou clicked and it happened! Javascript is the programming language of HTML and the Web.
BETTER USER EXPERIENCEJS makes your webpage respond interactively to the user
<script>JS on your HTML page lives within the <script></script> tags
LIVES ANYWHERE, REALLY<script> tags can show up anywhere – in the head or body section
<script src>You link up with external JS file via the same <script> but pointing the src attribute to the file
JS Output.alert, doc.write, innerHTML, console
DOM
DOCUMENT OBJECT MODELThis is how JS is able to access and change elements in an HTML document
DOM documentThat’s your webpage, JS represents it simply as document
Finding stuff.By: ID, Tag name, Class name
Elements..innerHTML, .attribute,
.setAttribute, .style.property
Functions
function()Functions are smart ways of achieving things in JS. They’re reusable.
NOTEJavaScript is case-sensitive, so nest is not the same as Nest
Timers.interval, timeout
Events.when something happens…
Aim, Fire!!!Events are things that happen to HTML elements, JS reacts to these events
What to do with an eventYou handle them with event handlers (which are actually just functions [code blocks])
COMMON EVENTSonload, onchange, onclick, onmouseover, onmouseout, onkeydown
BOM
BROWSER OBJECT MODELThis is how JS is able to talk to the browser
Some BOM.history, location
Popups.alert, prompt, confirm
Conditions.Ifs, elses, and switches
Loops.for (i = 0; i < 5; i++), while (i < 10)
Strings.and their awesome features
To the Laband we’ll stay there
See ya!