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
fa Persian Download
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
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: WEBVTT 1 00:00:00.000 --> 00:00:04.000 Now while we can 2 00:00:04.000 --> 00:00:08.000 easily write JavaScript code in between the script element, in a real 3 00:00:08.000 --> 00:00:12.000 world application, you have 1000 maybe even a million lines of code, we don't want to 4 00:00:12.000 --> 00:00:16.000 write all that code in line here. We want to extract and 5 00:00:16.000 --> 00:00:20.000 separate our JavaScript code from our html code. Let me give you a 6 00:00:20.000 --> 00:00:24.000 metaphor. Think of your house. In your bedroom you have your 7 00:00:24.000 --> 00:00:28.000 bed, and your clothes, you don't store your clothes in the kitchen. This is 8 00:00:28.000 --> 00:00:32.000 what we call separation of concerns. You have the same principle 9 00:00:32.000 --> 00:00:36.000 in programming so we want to separate html which is all about content, 10 00:00:36.000 --> 00:00:40.000 from JavaScript which is all about behavior. How should 11 00:00:40.000 --> 00:00:44.000 your web page behave, what should happen when we hover our mouse 12 00:00:44.000 --> 00:00:48.000 over a given element? Maybe something should pop up maybe something should be hidden, 13 00:00:48.000 --> 00:00:52.000 so we use JavaScript to implement behavior. So, 14 00:00:52.000 --> 00:00:56.000 open up the explorer window, add the new file, 15 00:00:56.000 --> 00:01:00.000 call it index.js. 16 00:01:00.000 --> 00:01:04.000 Now, back in index.html, cut all this 17 00:01:04.000 --> 00:01:08.000 JavaScript code here, and then paste it in index.js, 18 00:01:08.000 --> 00:01:12.000 now in this simple application we have a single 19 00:01:12.000 --> 00:01:16.000 file, a single JavaScript file, in a real world application we have hundreds or even 20 00:01:16.000 --> 00:01:20.000 thousands of JavaScript files. Later in the course you will learn how to 21 00:01:20.000 --> 00:01:24.000 combine these files into a bundle, and serve that bundle into the client. 22 00:01:24.000 --> 00:01:28.000 Now, save the changes, back in index. 23 00:01:28.000 --> 00:01:32.000 html, now that all our JavaScript code is in a separate file 24 00:01:32.000 --> 00:01:36.000 we need to reference that file here. So, 25 00:01:36.000 --> 00:01:40.000 let's add an attribute here, src, which is short for src, 26 00:01:40.000 --> 00:01:44.000 and set it to index.js. 27 00:01:44.000 --> 00:01:48.000 So this tells the browsers that our JavaScript code 28 00:01:48.000 --> 00:01:52.000 is now in index.js save the changes 29 00:01:52.000 --> 00:01:56.000 back in the browser, you can still see the Hello World message 30 00:01:56.000 --> 00:02:00.000 and that confirms that our code is still working. In the next lecture, 31 00:02:00.000 --> 00:02:04.000 we're going to execute this code in Node. 2799

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