WebProgramming Academy

Chapter One: Introduction to JavaScript

JavaScript is a programming language that determines the behavior of the web browser. The way it determines the behavior the web page is how the user interacts with the web browser. One example of JavaScript is data validation. If the user types a letter when asked for zip code, JavaScript will be prompt to tell the user that letters are not allowed in the zip code field and only numbers are valid.

Internal JavaScript

Internal javascript is coding javascript into the HTML file. Coding your javascript internally is useful if you plan to use the code only once. Do not use this method if you plan to reuse the javascript code more than once.

Script Element

The script element is used for internal javascript. It tells the web browser that one section will have some javascript code.

External JavaScript

Exernal javascript is coding in a different file and linking it to your HTML file. This is useful if you plan to reuse the code many times. It also seperates the HTML code from the javascript code, so it will be easier to find if the code needs to be fixed or deleted.