diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/index.html b/1-js/02-first-steps/01-hello-world/1-hello-alert/index.html index ff1d871b0..9e332d59c 100644 --- a/1-js/02-first-steps/01-hello-world/1-hello-alert/index.html +++ b/1-js/02-first-steps/01-hello-world/1-hello-alert/index.html @@ -4,7 +4,7 @@ diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html b/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html index 45e6744b3..9e332d59c 100644 --- a/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html +++ b/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html @@ -4,9 +4,9 @@ - \ No newline at end of file + diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md b/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md index afed6a91d..2d31c8177 100644 --- a/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md +++ b/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md @@ -1,12 +1,12 @@ -importance: 5 +važnost: 5 --- -# Show an alert +# Pokaži alert -Create a page that shows a message "I'm JavaScript!". +Napravi stranicu koja pokazuje poruku "Ja sam JavaScript!". -Do it in a sandbox, or on your hard drive, doesn't matter, just ensure that it works. +Uradi bilo gdje, nije bitno, samo budi siguran da radi ispravno. [demo src="solution"] diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/alert.js b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/alert.js index 4de725971..f62db4e89 100644 --- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/alert.js +++ b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/alert.js @@ -1 +1 @@ -alert("I'm JavaScript!"); \ No newline at end of file +alert("Ja sam JavaScript!"); diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md index f42c41e6d..d9bf651f0 100644 --- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md +++ b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md @@ -1,8 +1,8 @@ -The HTML code: +HTML kod: [html src="index.html"] -For the file `alert.js` in the same folder: +Za datoteku `alert.js` koja se nalazi u istom folderu: [js src="alert.js"] diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md index 26168d6a7..e684cf3cb 100644 --- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md +++ b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md @@ -1,9 +1,9 @@ -importance: 5 +važnost: 5 --- -# Show an alert with an external script +# Pokaži alert sa eksternom skriptom -Take the solution of the previous task . Modify it by extracting the script content into an external file `alert.js`, residing in the same folder. +Uzmi rješenje prošlog zadatka . Izmjeni ga tako što ćeš sadržaj skripte prebaciti u eksternu datoteku `alert.js`, koja se nalazi u istom folderu. -Open the page, ensure that the alert works. +Otvori stranicu, budi siguran da alert radi ispravno. diff --git a/1-js/02-first-steps/01-hello-world/article.md b/1-js/02-first-steps/01-hello-world/article.md index b3149f112..0d2f56157 100644 --- a/1-js/02-first-steps/01-hello-world/article.md +++ b/1-js/02-first-steps/01-hello-world/article.md @@ -1,17 +1,17 @@ # Hello, world! -This part of the tutorial is about core JavaScript, the language itself. +Ovaj dio tutorijala je o jezgri samog jezika, JavaScript-a. -But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.js). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial. +Ali nam treba radno okruženje gdje ćemo pokretati naše skripte, i pošto je ova knjiga na internetu, pretraživač je dobar izbor. Nećemo puno koristiti komande specifične za pretraživače (kao što je `alert`) tako da ne provedete puno vremena na njih ako planirate da se koncentrirate na drugo okruženje (kao na primjer Node.js). Fokusirat ćemo se na JavaScript u pretraživaču u [sljedećem dijelu](/ui) tutorijala. -So first, let's see how we attach a script to a webpage. For server-side environments (like Node.js), you can execute the script with a command like `"node my.js"`. +Prvo, hajmo vidjeti kako povezati skriptu sa web stranicom. Za okruženja sa serverske strane (kao što je Node.js), možete izvršiti skriptu sa ovom komandom `"node my.js"`. -## The "script" tag +## "script" oznaka (eng. tag) -JavaScript programs can be inserted into any part of an HTML document with the help of the ` */!* -

...After the script.

+

...Poslije skripte.

@@ -35,24 +35,24 @@ For instance: ``` ```online -You can run the example by clicking the "Play" button in the right-top corner of the box above. +Možete pokrenuti ovaj primjer tako što ćete pritisnuti "Play" tipku u gornjem desnom uglu kocke iznad. ``` -The ` ``` - This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the ` + ``` -Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder. +Ovdje, `/put/do/script.js` je apsolutan put do skripte od korijena stranice. Možete pružiti relativni put od trenutne stranice. Na primjer, `src="script.js"` bi značilo `"script.js"` je u trenutnom folderu. -We can give a full URL as well. For instance: +Možemo dati i potpuni URL također. Na primjer: ```html ``` -To attach several scripts, use multiple tags: +Da bismo povezali više skript datoteka, koristimo više tagova: ```html @@ -90,43 +90,43 @@ To attach several scripts, use multiple tags: ``` ```smart -As a rule, only the simplest scripts are put into HTML. More complex ones reside in separate files. +Kao pravilo, samo najjednostavnije skripte se postavljaju direktno u HTML. One koje su više kompleksne trebaju biti u eksternim, odvojenim datotekama. -The benefit of a separate file is that the browser will download it and store it in its [cache](https://en.wikipedia.org/wiki/Web_cache). +Prednost odvojene datoteke jeste to da će je pretraživač preuzeti i spasiti u [keš memoriju](https://en.wikipedia.org/wiki/Web_cache). -Other pages that reference the same script will take it from the cache instead of downloading it, so the file is actually downloaded only once. +Ostale stranice koje uzimaju istu skriptu kao referencu uzeti će iz keš memorije umjesto ponovnog preuzimanja, tako da se ta datoteka samo jednom treba preuzeti. -That reduces traffic and makes pages faster. +To smanjuje promet i ubrzava stranicu. ``` -````warn header="If `src` is set, the script content is ignored." -A single ` ``` -We must choose either an external ` + ``` ```` -## Summary +## Sažetak -- We can use a ``. +- Možemo koristiti ``. -There is much more to learn about browser scripts and their interaction with the webpage. But let's keep in mind that this part of the tutorial is devoted to the JavaScript language, so we shouldn't distract ourselves with browser-specific implementations of it. We'll be using the browser as a way to run JavaScript, which is very convenient for online reading, but only one of many. +Ima još mnogo toga da se nauči o skriptama u pretraživaču kao i o njihovoj interakciji sa web stranicom. Ali moramo imati na umu da je ovaj dio tutorijala posvećen JavaScript jeziku, tako da ne želimo odvratiti pažnju sa implementacijama specifičnim za pretraživače. Koristit ćemo pretraživač kao način da pokrenemo JavaScript, što je veoma pogodno za online čitanje, ali to je samo jedan od načina.