Grammatical and wording updates
This commit is contained in:
parent
758b24ce5c
commit
843e5f32b1
1 changed files with 4 additions and 4 deletions
|
@ -47,10 +47,10 @@ The `<script>` tag has a few attributes that are rarely used nowadays, but we ca
|
|||
|
||||
The `type` attribute: <code><script <u>type</u>=...></code>
|
||||
|
||||
: The old standard HTML4 required a script to have a type. Usually it was `type="text/javascript"`. It's not required any more. Also, the modern standard totally changed the meaning of this attribute. Now it can be used for Javascript modules. But that's an advanced topic, but we'll talk about modules later in another part of the tutorial.
|
||||
: The old standard HTML4 required a script to have a type. Usually it was `type="text/javascript"`. It's not required any more. Also, the modern standard totally changed the meaning of this attribute. Now it can be used for Javascript modules. But that's an advanced topic; we'll talk about modules later in another part of the tutorial.
|
||||
|
||||
The `language` attribute: <code><script <u>language</u>=...></code>
|
||||
: This attribute was meant to show the language of the script. As of now, this attribute makes no sense, the language is JavaScript by default. No need to use it.
|
||||
: This attribute was meant to show the language of the script. This attribute no longer makes sense, because JavaScript is the default language. No need to use it.
|
||||
|
||||
Comments before and after scripts.
|
||||
: In really ancient books and guides, one may find comments inside `<script>`, like this:
|
||||
|
@ -61,7 +61,7 @@ Comments before and after scripts.
|
|||
//--></script>
|
||||
```
|
||||
|
||||
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 `<script>` tag. Since browsers born in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
|
||||
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 `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
|
||||
|
||||
|
||||
## External scripts
|
||||
|
@ -78,7 +78,7 @@ Here `/path/to/script.js` is an absolute path to the file with the script (from
|
|||
|
||||
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.
|
||||
|
||||
We can give a full URL as well, for instance:
|
||||
We can give a full URL as well. For instance:
|
||||
|
||||
```html
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue