From 52e2819264a9aeecfb0cdc31760d4e05905cb3f7 Mon Sep 17 00:00:00 2001 From: imidom Date: Thu, 27 Dec 2018 12:09:21 -0500 Subject: [PATCH] Updated article.md for syntax / grammar Sorry for the delay! --- 1-js/02-first-steps/01-hello-world/article.md | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) 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 af486b3f..a24d3dca 100644 --- a/1-js/02-first-steps/01-hello-world/article.md +++ b/1-js/02-first-steps/01-hello-world/article.md @@ -1,15 +1,15 @@ # Hello, world! -The tutorial that you're reading is about core JavaScript, which is platform-independent. Further on, you will learn Node.JS and other platforms that use it. +The tutorial that you're reading is about core JavaScript, which is platform-independent. Later on, you'll learn about Node.JS and other platforms that use it. -But, we need a working environment to run our scripts, and, just because 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. On the other hand, browser details are explained in detail in the [next part](/ui) of the tutorial. +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. -So first, let's see how to attach a script to a webpage. For server-side environments, you can just execute it with a command like `"node my.js"` for Node.JS. +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"`. ## The "script" tag -JavaScript programs can be inserted in any part of an HTML document with the help of the ` ``` - This trick isn't used in modern JavaScript. These comments were used to hide the JavaScript code from old browsers that didn't know about a ` ``` -Here `/path/to/script.js` is an absolute path to the file with the script (from the site root). +Here, `/path/to/script.js` is an absolute path to the script file (from the site root). -It is also possible to provide a path relative to the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder. +You 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. We can give a full URL as well. For instance: @@ -95,15 +94,15 @@ 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. -The benefit of a separate file is that the browser will download it and then store it in its [cache](https://en.wikipedia.org/wiki/Web_cache). +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). -After this, other pages that want the same script will take it from the cache instead of downloading it. So the file is actually downloaded only once. +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. -That saves traffic and makes pages faster. +That reduces traffic and makes pages faster. ``` ````warn header="If `src` is set, the script content is ignored." -A single ` ``` -We must choose: either it's an external ``. -There is much more to learn about browser scripts and their interaction with the web-page. But let's keep in mind that this part of the tutorial is devoted to the JavaScript language, so we shouldn't distract ourselves from it. We'll be using a browser as a way to run JavaScript, which is very convenient for online reading, but yet one of many. +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.