Why Bother Learning Javascript?

#1 Why Bother Learning Javascript?

# 1 Review Questions

# 1 Assignment

There are other things to do:

  • Watch a soap.
  • Count the clouds.
  • Check your toenails.

But that would leave your web pages rather flat and lifeless. The World Wide Web was initially created for the purpose of sharing information in scientific and academic communities. Documents were posted on the web in Hypertext Markup Language (HTML) and viewed by programs called browsers. Everything was "look but don't touch"! Documents could be viewed or printed, but that is all.

Now, we expect Web pages to be more responsive, more dynamic, and more tailored to the user. So we need a different tool. To see what the difference is,

What is JavaScript?

Javascript is a tool developed by Netscape in 1995. JavaScript can allow your web pages to be interactive. In Europe, some computer manufacturers came out with ECMAScript to run under their browsers. No matter which scripting tool you choose, you can thank Netscape for getting this whole idea started.

Browser Wars

(Ha ha... Chrome hadn't been invented yet, nor Firefox...)

One thing you should know about the two most popular browsers is they fight like mad dogs to try to be the best and only thing that anyone would ever use. It is actually for the best of all computer users that one company doesn't have everyone in the palm of its hand. But web developers need to know that the two Biggies out there, namely Microsoft's Internet Explorer (IE for short) and Netscape will handle both HTML and JavaScript differently at times. Your goal should always be to use features that are commonly available to all your users, regardless of which popular browser they may have. Nuff fighting!

To see some JavaScript in action, check out these links;

Javascript is an easy-to-use programming language that can be used to make your web pages come to life. They can allow the user to input some data into a form, then act on that information. It can perform calculations, check for valid information, play games, and even affect the way the browser behaves. It uses variables to store information, if-thens and looping to control logic, functions to perform image swaps, and much much more. If you learn some Javascript, then learning other programming languages later will be easier. And if you are a smarty-cat and already know another programming language, then learning Javascript is a piece of

Speaking of cake - the image of the cake is actually an Object. JavaScript is Object-Oriented, so we will learn about objects, events, and methods. One of the first features we will learn are methods called Event Handlers. In browsers, we like to move from window to window, and click the mouse when we want some action. Those moves are called Events, and JavaScript has some built-in functions called methods to react to each. Move your mouse over this image to see the onMouseOver event handler in action.

What's the difference between JavaScript and Java?

Lots!! So they share the same name - so do John Elway and Elton John, but the two have, shall we say, different talents.

Java is a language developed by Sun Microsystems that is not usually recommended for beginners. It is an interpreted language, that is put together with some library files and class files to create executable code. If it runs within a browser, the program is called an "applet", or it can run on its own as a major application program. Java is a good thing to learn, since it can be run on computers with many different operating systems, Macs, Unix, Linux, Windows.

Javascript is much simpler to learn, and doesn't need any other expensive products to run - just your browser. And the Inspect / console of most browsers has some features to help you catch errors - just in case you make one.

What should I know before Starting This Tutorial?

You should have some background in writing HTML and the gist of how to design a Web Page, but you need not be an expert. Here is a list of the most crucial things you should be familiar with.

HTML to Know and Love

Common Tags           <HTML>                   <HEAD>                   <!-- HTML COMMENTS - BELOW ARE SOME USEFUL TAGS USED IN HEAD SECTION -->
<TITLE>                  <STYLE>                  <LINK>                    <SCRIPT> <!-- ignored if browser doesn't support -->                               <BASE>                   
<META>    </HEAD>                 <BODY...>  <!-- SOME USEFUL TAGS USED IN THE BODY SECTION -->              attributes used within BODY tag:  ALINK, BACKGROUND, BGCOLOR, LINK, TEXT, VLINK,                            <P>&nbsp;                               <PRE>                      <H1> through <H6>                   <IMG...>                   <A...>                        <H>                        <STRONG>                          <EM>                          <BR>                        <TABLE>            
     
<FORM>                   <INPUT...>
<!-- there are buttons, text boxes, radio and checkboxes in this tag ..></BODY></HTML>You should also know about saving web pages in a common folder with proper filenames (using index.html as the opening page).

 

Return to Top of Page | Back to Main Menu