All language subtitles for 5- Separation of Concerns

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Now while we can

easily write JavaScript code in between the script element, in a real

world application, you have 1000 maybe even a million lines of code, we don't want to

write all that code in line here. We want to extract and

separate our JavaScript code from our html code. Let me give you a

metaphor. Think of your house. In your bedroom you have your

bed, and your clothes, you don't store your clothes in the kitchen. This is

what we call separation of concerns. You have the same principle

in programming so we want to separate html which is all about content,

from JavaScript which is all about behavior. How should

your web page behave, what should happen when we hover our mouse

over a given element? Maybe something should pop up maybe something should be hidden,

so we use JavaScript to implement behavior. So,

open up the explorer window, add the new file,

call it index.js.

Now, back in index.html, cut all this

JavaScript code here, and then paste it in index.js,

now in this simple application we have a single

file, a single JavaScript file, in a real world application we have hundreds or even

thousands of JavaScript files. Later in the course you will learn how to

combine these files into a bundle, and serve that bundle into the client.

Now, save the changes, back in index.

html, now that all our JavaScript code is in a separate file

we need to reference that file here. So,

let's add an attribute here, src, which is short for src,

and set it to index.js.

So this tells the browsers that our JavaScript code

is now in index.js save the changes

back in the browser, you can still see the Hello World message

and that confirms that our code is still working. In the next lecture,

we're going to execute this code in Node.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.