The introduction of JavaScript into web pages immediately ran into the Web’s main language, HTML. As the component of its original work on JavaScript, Netscape tried to find out how to make JavaScript coexist in HTML pages without making any break on those pages which is rendering in other browsers. Through trial and error along with controversy, several decisions were finally made and agreed upon to bring universal scripting support for the Web. Most of the work done in these early days of the Web has endured and become official in the HTML specification. In this chapter you are going to relate the JavaScript language with HTML.
Use of <SCRIPT> Element
The primary technique of inserting JavaScript into any HTML page is through the <script> element. This <script> element was created by Netscape and first implemented in the browser – Netscape Navigator version 2. Then it was later added to the formal HTML specification.
Six attributes are provided by the <script> el
ement. These are:Attribute | Description |
---|---|
async | which indicates that the script ought to begin downloading immediately. |
charset | set the character set of the code particularize using the src attribute. |
defer | which indicates that the execution of the script can safely be deferred until after the document’s content has been fully parsed and displayed. |
language | which indicates that the scripting language being used by the code. |
src | which indicates that an external file that holds the code to be executed. |
type | is used to replace language; indicates the content type (also called MIME type) of the scripting language being used. |
0 Comments
If you have any doubts,please let me know