SlideShare a Scribd company logo
Introduction to web
programming with
JavaScript
#t11sessions
T11 Sessions
● A series of workshops, talks and presentations
from various practical fields
● Once per month
● Future workshops: Introduction to 3D graphics,
Introduction to philosophy etc.
● Inspired by T11, opened for all
● Facebook | t11sessions@gmail.com
Discourse and /me
● Been into this thing for ~10 years, but more actively
involved last ~5 years
● Happily unemployed
● Don’t expect magic - I’m here to give you some basic
knowledge and understanding (nothing is a black box)
● Continuation?
● Ask / Write questions
Discourse and /me
● Been into this thing for ~10 years, but more actively
involved last ~5 years
● Happily unemployed
● Don’t expect magic - I’m here to give you some basic
knowledge and understanding (nothing is a black box)
● Continuation?
● Ask / Write questions
● Task at the end
Backend / Frontend web development - what’s up with
that?
● Backend development is related mostly to the data, data
processing and calculations that are not directly
interacting with the user
● Frontend development is related to the elements of a
website that are visible to the user and that user interacts
with (combination of programming skills and aesthetics)
Backend web development - what’s up with that?
Frontend web development - what’s up with that?
Frontend web development - what’s up with that?
HTML (Hyper Text Markup Language) &
CSS (Cascading Style Sheets)
● HTML - web programming language that tells web
browsers how to structure and present content on a web
page (a, p, h1, h2, lists, header, footer, etc)
● CSS - defines a web page’s layout and in order to beautify
the page with design elements like colors, rounded
corners, gradients, and animation (attached to classes, ids
and so on)
HTML & CSS
<html>
<head>
<title>Motherfucking Website</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>This is a motherfucking website.</h1>
<p class="alert-text">This is a part of '.alert-text' class and it's painted red (color: #FF0000;)</p>
<p class="alert-text bold-text">This one extends '.alert-text' but it also adds an additional style</p>
</body>
</html>
HTML & CSS
<p class="alert-text">This is a part of '.alert-
text' class and it's obviously painted red
(color: #FF0000;)</p>
.alert-text {
color: #FF0000;
}
This is a part of '.alert-text' class and it's
painted red (color: #FF0000;)
Hey browser, show me that website!
● Simple scenario:
Open your preferable (Chrome, for example) browser, go
to a specific website -> http://motherfuckingwebsite.com/
Server
http://www.mothefuckingwebsite.com
Your
browser
BROWSER MAKES A GET REQUEST TO /
RESPONSE (HTML, JS, CSS, IMAGES)
USER REQUIRES A www.motherfuckingwebsite.com
46.164.50.177 66.147.244.191
index.html style.css
main.jsimage.jpg image_1.jpg
<script type="text/javascript" src="main.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<img src=”image.jpg”> <img src=”image_1.jpg”>
● JavaScript is not Java!
● Dynamic programming language most commonly used as
part of web websites (interacts with the user, controls the
browser, used for games, form validations etc) - basically
every website today is using JavaScript
● Simple, easy to read and understand and there’s a lot of
resources, which is both good and bad
● No need to setup anything in order to use it
JavaScript introduction
JavaScript - what exactly is it used for?
● Random calculations (1)
● Animations (1, 2, 3)
● Dynamically change colors and other styles (1, 2)
● Form validations
● Some more heavy shit! (1, 2)
● Dynamically load data
Javascript / Browser console
● Chrome / Firefox - right mouse click, then select “Inspect”
(or: CTRL + SHIFT + i)
● Examples: Declare a variable, string length, alert(“Hello
World!”), select elements, simple calculations, inspect and
change element etc.
● copy(someArray.toString());
JavaScript overview
● Variables (String, Number, Boolean, Array, Object)
● Operators (+, -, /, *, =, ===, !, !==, &&, ||)
● Events (associated mostly with user behavior)
● Conditionals (if, if else, switch, for, …)
● Functions (built-in functions + custom ones)
● Comments (/* comment */, // comment)
JavaScript variables
Types: String, Number, Boolean, Array, Object
● Comparable with mathematics (x = 10, y = 1, z = 5)
● var dayOfTheMonth; // declares a variable, undefined
● var dayOfTheMonth = 12; // declares and assigns a
variable, Number
● var monthName = "April"; // declares and assigns, String
● var dogs = ["Fluffy", "April", "Archibald"]; // Array
● var person = { firstName: "April", lastName: "June" }; //
Object
JavaScript operators
● Similar to math
● Basic operators: +, -, /, *
● Assignment operator: =
● Equality operators: ===, !==, <, >
● Logical operators: && (and), || (or) and ! (not)
JavaScript logical operators
● And (&&)
○ true && true == true
○ true && false == false
○ false && true == false
○ false && false == false
● Or (||)
○ true || true == true
○ true || false == true
○ false || true == true
○ false || false == false
● Not (!)
○ !true == false
○ !false == true
JavaScript logical operators
● And (&&)
○ true && true == true
○ true && false == false
○ false && true == false
○ false && false == false
● Or (||)
○ true || true == true
○ true || false == true
○ false || true == true
○ false || false == false
● Not (!)
○ !true == false
○ !false == true
JavaScript events
● Completely related to web development, and user
behavior
● You can define what to do when user clicks on a specific
button, selects an a different value in dropdown, gets
focus into a specific element and so on
● You can register them either in HTML or in JS
JavaScript statements (if)
var yourName = prompt("Please enter your name", ""); // gets the entered name
// if you don't provide a name, you'll become "Anonymous"
if (yourName === '') {
yourName = 'Anonymous';
}
JavaScript statements (if else)
var yourName = prompt("Please enter your name", ""); // gets the entered name
// if you don't provide a name, you'll become "Anonymous"
if (yourName === '') {
yourName = 'Anonymous';
} else if (yourName === 'Barack Obama') {
yourName = 'Anonymous';
}
JavaScript statements (switch)
var yourName = prompt("Please enter your name", ""); // gets the entered name
switch (yourName) {
case '':
yourName = 'Anonymous';
break;
case 'Barack Obama':
yourName = 'Anonymous';
break;
default: // all other cases
// don’t do anything
}
JavaScript statements (for)
var dogs = ["Fluffy", "April", "Archibald"]; // array of dogs
// prints out all the dogs
for (var i = 0; i < dogs.length; i++) {
alert(dogs[i]);
}
0 1 2
JavaScript statements (while)
var dogs = ["Fluffy", "April", "Archibald"]; // array of dogs
// does the same as for loop
var i = 0;
while (i < dogs.length) {
alert(dogs[i]);
i++;
}
0 1 2
JavaScript functions
● Closely connected with mathematics
● Built in functions (String has length, substring, text can be
converted into Number etc)
● Custom functions (write whatever you want)
JavaScript functions (examples)
Math
x2
(x - input)
x+y (x, y - inputs)
x + y / z (x, y, z - inputs)
JavaScript
function square(x) {
return x*x;
}
function addition(x, y) {
return x + y;
}
function randomFormula(x, y, z) {
return (x + y) / z;
}
JavaScript call
square(2); // 4
addition(4,4); // 8
randomFormula(5,5,2); // 5
JavaScript functions (examples)
Math
F = 9/5 * C + 32 (C - input)
C = 5/9 * (F - 32) (F - input)
D = b2
- 4*a*c
JavaScript
function celsiusToFahrenheit(celsius) {
return ((9 / 5) * celsius) + 32;
}
function fahrenheitToCelsius(fahrenheit) {
return (5 / 9) * (fahrenheit - 32);
}
function discriminant(a, b, c) {
return Math.pow(b,2) - (4 * a * c);
}
JavaScript call
celsiusToFahrenheit(30); // 86
fahrenheitToCelsius(77); // 25
discriminant(2,2,2); // -12
JavaScript vs. jQuery
● jQuery is basically just a wrapper for JavaScript, that
simplifies and beautifies the code
● document.getElementById(“test”) -> $(“#test”)
● document.getElementsByClassName(“test”) -> $(“.test”)
● Can be useful, but don’t rush :)
Tools
● For writing code: Sublime Text or Atom or Notepad++
● Write code online: JSFiddle
● Web browser by choice (recommendation: Chrome) and
browser console
● Versioning: Git and Github
● Simple Python server (for later use)
Where and how to continue?
● Codecademy (1, 2, 3, 4, overview)
● Coursera (1, 2, 3, 4, 5)
● Quick tutorials and exercises (1, 2, 3)
● 20 things I’ve learned about browsers and web
● Random JavaScript examples (1, 2, 3)
● Start your own project!
● Real life courses (1)
● Google, a lot! Beware: you’ll find a lot of bad examples online
Tasks - how to deal with it?
● Download .zip file
○ index.html
○ style.css
○ main.js
○ images/image.jpg
○ images/image_1.jpg
Tasks - how to deal with it?
● Download .zip file
● Export files to /home/dev/t11sessions or similar directory
● Get Sublime Text or similar text/code editor
● Open index.html in Sublime Text and in preferable browser
(Open with…, then select preferable app)
● Observe index.html (both code and browser), try to
change/update things and go through TODO tasks
● Open main.js and style.css, read comments and TODO tasks
Thanks for your attention
peric.drazhen@gmail.com
@dperitch

More Related Content

What's hot (20)

Learn react-js
Learn react-jsLearn react-js
Learn react-js
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
shreesenthil
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
Priya Goyal
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
Arnold Asllani
 
Java script ppt
Java script pptJava script ppt
Java script ppt
The Health and Social Care Information Centre
 
Xml schema
Xml schemaXml schema
Xml schema
Prabhakaran V M
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
OECLIB Odisha Electronics Control Library
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
Bui Kiet
 
Java script final presentation
Java script final presentationJava script final presentation
Java script final presentation
Adhoura Academy
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation Technique
Morshedul Arefin
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
WebStackAcademy
 
Java script
Java scriptJava script
Java script
Sadeek Mohammed
 
Javascript
JavascriptJavascript
Javascript
Manav Prasad
 
Xml parsers
Xml parsersXml parsers
Xml parsers
Manav Prasad
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
Arulmurugan Rajaraman
 
Introduction to JavaScript Basics.
Introduction to JavaScript Basics.Introduction to JavaScript Basics.
Introduction to JavaScript Basics.
Hassan Ahmed Baig - Web Developer
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
Shlomi Komemi
 

Viewers also liked (20)

Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
Marco Cedaro
 
Javascript Tutorial
Javascript TutorialJavascript Tutorial
Javascript Tutorial
Kang-min Liu
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
guestceb98b
 
The JavaScript Programming Primer
The JavaScript  Programming PrimerThe JavaScript  Programming Primer
The JavaScript Programming Primer
Mike Wilcox
 
Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...
Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...
Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...
IJSRD
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
Raghavan Mohan
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101
Mindy McAdams
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScript
Codemotion
 
Introduction to JavaScript Programming
Introduction to JavaScript ProgrammingIntroduction to JavaScript Programming
Introduction to JavaScript Programming
Collaboration Technologies
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScript
Troy Miles
 
Biomass gasifier pune
Biomass gasifier  puneBiomass gasifier  pune
Biomass gasifier pune
road2ideas
 
Downdraft biomass gasification: experimental investigation and aspen plus sim...
Downdraft biomass gasification: experimental investigation and aspen plus sim...Downdraft biomass gasification: experimental investigation and aspen plus sim...
Downdraft biomass gasification: experimental investigation and aspen plus sim...
Antonio Geraldo de Paula Oliveira
 
Biomass Gasification presentation
Biomass Gasification presentationBiomass Gasification presentation
Biomass Gasification presentation
Pritish Shardul
 
Bio Mass Gasifier
Bio Mass GasifierBio Mass Gasifier
Bio Mass Gasifier
Rochester Institute of Technology
 
Biomass Gasification
Biomass GasificationBiomass Gasification
Biomass Gasification
Er Soumyabrata Basak
 
Biomass heat and power - gasification CHP with universal biomass gasifier
Biomass heat and power - gasification CHP with universal biomass gasifierBiomass heat and power - gasification CHP with universal biomass gasifier
Biomass heat and power - gasification CHP with universal biomass gasifier
Rado Irgl
 
biomass gasification
biomass gasificationbiomass gasification
biomass gasification
Akepati S. Reddy
 
Biomass gassifier
Biomass gassifierBiomass gassifier
Biomass gassifier
Aravind Rajan
 
DIWE - Programming with JavaScript
DIWE - Programming with JavaScriptDIWE - Programming with JavaScript
DIWE - Programming with JavaScript
Rasan Samarasinghe
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Bryan Basham
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
Marco Cedaro
 
Javascript Tutorial
Javascript TutorialJavascript Tutorial
Javascript Tutorial
Kang-min Liu
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
guestceb98b
 
The JavaScript Programming Primer
The JavaScript  Programming PrimerThe JavaScript  Programming Primer
The JavaScript Programming Primer
Mike Wilcox
 
Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...
Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...
Fabrication and Performance Analysis of Downdraft Biomass Gasifier Using Suga...
IJSRD
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
Raghavan Mohan
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScript
Codemotion
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScript
Troy Miles
 
Biomass gasifier pune
Biomass gasifier  puneBiomass gasifier  pune
Biomass gasifier pune
road2ideas
 
Downdraft biomass gasification: experimental investigation and aspen plus sim...
Downdraft biomass gasification: experimental investigation and aspen plus sim...Downdraft biomass gasification: experimental investigation and aspen plus sim...
Downdraft biomass gasification: experimental investigation and aspen plus sim...
Antonio Geraldo de Paula Oliveira
 
Biomass Gasification presentation
Biomass Gasification presentationBiomass Gasification presentation
Biomass Gasification presentation
Pritish Shardul
 
Biomass heat and power - gasification CHP with universal biomass gasifier
Biomass heat and power - gasification CHP with universal biomass gasifierBiomass heat and power - gasification CHP with universal biomass gasifier
Biomass heat and power - gasification CHP with universal biomass gasifier
Rado Irgl
 
DIWE - Programming with JavaScript
DIWE - Programming with JavaScriptDIWE - Programming with JavaScript
DIWE - Programming with JavaScript
Rasan Samarasinghe
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Bryan Basham
 
Ad

Similar to Introduction to web programming with JavaScript (20)

JavaScript ES6
JavaScript ES6JavaScript ES6
JavaScript ES6
Leo Hernandez
 
Javascript note for engineering notes.pptx
Javascript note for engineering notes.pptxJavascript note for engineering notes.pptx
Javascript note for engineering notes.pptx
engineeradda55
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
dominion
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
Trivuz ত্রিভুজ
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
Núcleo de Electrónica e Informática da Universidade do Algarve
 
Drupaljam xl 2019 presentation multilingualism makes better programmers
Drupaljam xl 2019 presentation   multilingualism makes better programmersDrupaljam xl 2019 presentation   multilingualism makes better programmers
Drupaljam xl 2019 presentation multilingualism makes better programmers
Alexander Varwijk
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
Igor Sobreira
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
Anjan Banda
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
François Sarradin
 
BITM3730 10-17.pptx
BITM3730 10-17.pptxBITM3730 10-17.pptx
BITM3730 10-17.pptx
MattMarino13
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Iakiv Kramarenko
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)
aasarava
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
BG Java EE Course
 
UNIT 1 (7).pptx
UNIT 1 (7).pptxUNIT 1 (7).pptx
UNIT 1 (7).pptx
DrDhivyaaCRAssistant
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
Magecom Ukraine
 
Advanced Javascript Unit Testing
Advanced Javascript Unit TestingAdvanced Javascript Unit Testing
Advanced Javascript Unit Testing
Lars Thorup
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
David Padbury
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
dmethvin
 
Jquery 1
Jquery 1Jquery 1
Jquery 1
Manish Kumar Singh
 
JavaScript Needn't Hurt!
JavaScript Needn't Hurt!JavaScript Needn't Hurt!
JavaScript Needn't Hurt!
Thomas Kjeldahl Nilsson
 
Javascript note for engineering notes.pptx
Javascript note for engineering notes.pptxJavascript note for engineering notes.pptx
Javascript note for engineering notes.pptx
engineeradda55
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
dominion
 
Drupaljam xl 2019 presentation multilingualism makes better programmers
Drupaljam xl 2019 presentation   multilingualism makes better programmersDrupaljam xl 2019 presentation   multilingualism makes better programmers
Drupaljam xl 2019 presentation multilingualism makes better programmers
Alexander Varwijk
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
Igor Sobreira
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
Anjan Banda
 
BITM3730 10-17.pptx
BITM3730 10-17.pptxBITM3730 10-17.pptx
BITM3730 10-17.pptx
MattMarino13
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Iakiv Kramarenko
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)
aasarava
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
BG Java EE Course
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
Magecom Ukraine
 
Advanced Javascript Unit Testing
Advanced Javascript Unit TestingAdvanced Javascript Unit Testing
Advanced Javascript Unit Testing
Lars Thorup
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
David Padbury
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
dmethvin
 
Ad

Recently uploaded (20)

Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Soulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate reviewSoulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate review
Soulmaite
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
ELNL2025 - Unlocking the Power of Sensitivity Labels - A Comprehensive Guide....
Jasper Oosterveld
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Soulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate reviewSoulmaite review - Find Real AI soulmate review
Soulmaite review - Find Real AI soulmate review
Soulmaite
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to KnowWhat is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
What is Oracle EPM A Guide to Oracle EPM Cloud Everything You Need to Know
SMACT Works
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
DevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical PodcastDevOps in the Modern Era - Thoughtfully Critical Podcast
DevOps in the Modern Era - Thoughtfully Critical Podcast
Chris Wahl
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 

Introduction to web programming with JavaScript

  • 1. Introduction to web programming with JavaScript #t11sessions
  • 2. T11 Sessions ● A series of workshops, talks and presentations from various practical fields ● Once per month ● Future workshops: Introduction to 3D graphics, Introduction to philosophy etc. ● Inspired by T11, opened for all ● Facebook | [email protected]
  • 3. Discourse and /me ● Been into this thing for ~10 years, but more actively involved last ~5 years ● Happily unemployed ● Don’t expect magic - I’m here to give you some basic knowledge and understanding (nothing is a black box) ● Continuation? ● Ask / Write questions
  • 4. Discourse and /me ● Been into this thing for ~10 years, but more actively involved last ~5 years ● Happily unemployed ● Don’t expect magic - I’m here to give you some basic knowledge and understanding (nothing is a black box) ● Continuation? ● Ask / Write questions ● Task at the end
  • 5. Backend / Frontend web development - what’s up with that? ● Backend development is related mostly to the data, data processing and calculations that are not directly interacting with the user ● Frontend development is related to the elements of a website that are visible to the user and that user interacts with (combination of programming skills and aesthetics)
  • 6. Backend web development - what’s up with that?
  • 7. Frontend web development - what’s up with that?
  • 8. Frontend web development - what’s up with that?
  • 9. HTML (Hyper Text Markup Language) & CSS (Cascading Style Sheets) ● HTML - web programming language that tells web browsers how to structure and present content on a web page (a, p, h1, h2, lists, header, footer, etc) ● CSS - defines a web page’s layout and in order to beautify the page with design elements like colors, rounded corners, gradients, and animation (attached to classes, ids and so on)
  • 10. HTML & CSS <html> <head> <title>Motherfucking Website</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <h1>This is a motherfucking website.</h1> <p class="alert-text">This is a part of '.alert-text' class and it's painted red (color: #FF0000;)</p> <p class="alert-text bold-text">This one extends '.alert-text' but it also adds an additional style</p> </body> </html>
  • 11. HTML & CSS <p class="alert-text">This is a part of '.alert- text' class and it's obviously painted red (color: #FF0000;)</p> .alert-text { color: #FF0000; } This is a part of '.alert-text' class and it's painted red (color: #FF0000;)
  • 12. Hey browser, show me that website! ● Simple scenario: Open your preferable (Chrome, for example) browser, go to a specific website -> http://motherfuckingwebsite.com/
  • 13. Server http://www.mothefuckingwebsite.com Your browser BROWSER MAKES A GET REQUEST TO / RESPONSE (HTML, JS, CSS, IMAGES) USER REQUIRES A www.motherfuckingwebsite.com 46.164.50.177 66.147.244.191
  • 14. index.html style.css main.jsimage.jpg image_1.jpg <script type="text/javascript" src="main.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <img src=”image.jpg”> <img src=”image_1.jpg”>
  • 15. ● JavaScript is not Java! ● Dynamic programming language most commonly used as part of web websites (interacts with the user, controls the browser, used for games, form validations etc) - basically every website today is using JavaScript ● Simple, easy to read and understand and there’s a lot of resources, which is both good and bad ● No need to setup anything in order to use it JavaScript introduction
  • 16. JavaScript - what exactly is it used for? ● Random calculations (1) ● Animations (1, 2, 3) ● Dynamically change colors and other styles (1, 2) ● Form validations ● Some more heavy shit! (1, 2) ● Dynamically load data
  • 17. Javascript / Browser console ● Chrome / Firefox - right mouse click, then select “Inspect” (or: CTRL + SHIFT + i) ● Examples: Declare a variable, string length, alert(“Hello World!”), select elements, simple calculations, inspect and change element etc. ● copy(someArray.toString());
  • 18. JavaScript overview ● Variables (String, Number, Boolean, Array, Object) ● Operators (+, -, /, *, =, ===, !, !==, &&, ||) ● Events (associated mostly with user behavior) ● Conditionals (if, if else, switch, for, …) ● Functions (built-in functions + custom ones) ● Comments (/* comment */, // comment)
  • 19. JavaScript variables Types: String, Number, Boolean, Array, Object ● Comparable with mathematics (x = 10, y = 1, z = 5) ● var dayOfTheMonth; // declares a variable, undefined ● var dayOfTheMonth = 12; // declares and assigns a variable, Number ● var monthName = "April"; // declares and assigns, String ● var dogs = ["Fluffy", "April", "Archibald"]; // Array ● var person = { firstName: "April", lastName: "June" }; // Object
  • 20. JavaScript operators ● Similar to math ● Basic operators: +, -, /, * ● Assignment operator: = ● Equality operators: ===, !==, <, > ● Logical operators: && (and), || (or) and ! (not)
  • 21. JavaScript logical operators ● And (&&) ○ true && true == true ○ true && false == false ○ false && true == false ○ false && false == false ● Or (||) ○ true || true == true ○ true || false == true ○ false || true == true ○ false || false == false ● Not (!) ○ !true == false ○ !false == true
  • 22. JavaScript logical operators ● And (&&) ○ true && true == true ○ true && false == false ○ false && true == false ○ false && false == false ● Or (||) ○ true || true == true ○ true || false == true ○ false || true == true ○ false || false == false ● Not (!) ○ !true == false ○ !false == true
  • 23. JavaScript events ● Completely related to web development, and user behavior ● You can define what to do when user clicks on a specific button, selects an a different value in dropdown, gets focus into a specific element and so on ● You can register them either in HTML or in JS
  • 24. JavaScript statements (if) var yourName = prompt("Please enter your name", ""); // gets the entered name // if you don't provide a name, you'll become "Anonymous" if (yourName === '') { yourName = 'Anonymous'; }
  • 25. JavaScript statements (if else) var yourName = prompt("Please enter your name", ""); // gets the entered name // if you don't provide a name, you'll become "Anonymous" if (yourName === '') { yourName = 'Anonymous'; } else if (yourName === 'Barack Obama') { yourName = 'Anonymous'; }
  • 26. JavaScript statements (switch) var yourName = prompt("Please enter your name", ""); // gets the entered name switch (yourName) { case '': yourName = 'Anonymous'; break; case 'Barack Obama': yourName = 'Anonymous'; break; default: // all other cases // don’t do anything }
  • 27. JavaScript statements (for) var dogs = ["Fluffy", "April", "Archibald"]; // array of dogs // prints out all the dogs for (var i = 0; i < dogs.length; i++) { alert(dogs[i]); } 0 1 2
  • 28. JavaScript statements (while) var dogs = ["Fluffy", "April", "Archibald"]; // array of dogs // does the same as for loop var i = 0; while (i < dogs.length) { alert(dogs[i]); i++; } 0 1 2
  • 29. JavaScript functions ● Closely connected with mathematics ● Built in functions (String has length, substring, text can be converted into Number etc) ● Custom functions (write whatever you want)
  • 30. JavaScript functions (examples) Math x2 (x - input) x+y (x, y - inputs) x + y / z (x, y, z - inputs) JavaScript function square(x) { return x*x; } function addition(x, y) { return x + y; } function randomFormula(x, y, z) { return (x + y) / z; } JavaScript call square(2); // 4 addition(4,4); // 8 randomFormula(5,5,2); // 5
  • 31. JavaScript functions (examples) Math F = 9/5 * C + 32 (C - input) C = 5/9 * (F - 32) (F - input) D = b2 - 4*a*c JavaScript function celsiusToFahrenheit(celsius) { return ((9 / 5) * celsius) + 32; } function fahrenheitToCelsius(fahrenheit) { return (5 / 9) * (fahrenheit - 32); } function discriminant(a, b, c) { return Math.pow(b,2) - (4 * a * c); } JavaScript call celsiusToFahrenheit(30); // 86 fahrenheitToCelsius(77); // 25 discriminant(2,2,2); // -12
  • 32. JavaScript vs. jQuery ● jQuery is basically just a wrapper for JavaScript, that simplifies and beautifies the code ● document.getElementById(“test”) -> $(“#test”) ● document.getElementsByClassName(“test”) -> $(“.test”) ● Can be useful, but don’t rush :)
  • 33. Tools ● For writing code: Sublime Text or Atom or Notepad++ ● Write code online: JSFiddle ● Web browser by choice (recommendation: Chrome) and browser console ● Versioning: Git and Github ● Simple Python server (for later use)
  • 34. Where and how to continue? ● Codecademy (1, 2, 3, 4, overview) ● Coursera (1, 2, 3, 4, 5) ● Quick tutorials and exercises (1, 2, 3) ● 20 things I’ve learned about browsers and web ● Random JavaScript examples (1, 2, 3) ● Start your own project! ● Real life courses (1) ● Google, a lot! Beware: you’ll find a lot of bad examples online
  • 35. Tasks - how to deal with it? ● Download .zip file ○ index.html ○ style.css ○ main.js ○ images/image.jpg ○ images/image_1.jpg
  • 36. Tasks - how to deal with it? ● Download .zip file ● Export files to /home/dev/t11sessions or similar directory ● Get Sublime Text or similar text/code editor ● Open index.html in Sublime Text and in preferable browser (Open with…, then select preferable app) ● Observe index.html (both code and browser), try to change/update things and go through TODO tasks ● Open main.js and style.css, read comments and TODO tasks
  • 37. Thanks for your attention [email protected] @dperitch

Editor's Notes

  • #10: Show html/css examples
  • #11: Show html/css examples
  • #12: Show html/css examples
  • #16: It’s simple, easy to read and understand (“old-school” syntax) and there’s a lot of resources, which is both good and bad - think of that as a shared house where ten individuals haven’t agreed upon any specific rules (chores, cleaning, noise etc.)
  • #23: If (yourAge >= 18 && yourAge < 50) { // pass }