About us Privacy Disclaimer Contact us
FAQ Help Advertising Feedback
Home Sitemap Search Donate us

  Home > Computer & I'net > JavaScript Basics...

   Browse by title articles:
   What is hot:

JavaScript Basics

Variables

Events

More Basics

Functions

Arrays

Working With Graphics For The Web
Do-It-Yourself Keyword Optimization
while/do while
How To Use PDF Files On The Web
Prev articles1 2 345Next articles



JavaScript Basics


Computer & I'net articlesJavaScript Basics

by David Stanley    



As you may (or may not) know, JavaScript is not JAVA. This is a common error thinking JAVA is a shortened call for JavaScript. They are actually two very different types of coding. JavaScript is an addon script that enhances the performance or interaction of a website to its visitors. JAVA is like a small mini program in itself that is self contained and does special things.

JavaScript is a "block" type language. It views commands as separate blocks of information, binds them together, then executes them. Some examples of these blocks are document, window, src, write, and status.

Properties in JavaScipt are known as EVENTS. These events cause an action to happen under certain circumstances or instances. They are based on "LOGICAL" formulas. IF this is true THEN do this command. The formulas are based on a series of comparisons.

VERY IMPORTANT ... JavaScript is VERY picky. Be sure to pay close attention to returns and spaces or the script may not work properly. JavaScript is also CaSe SeNsItIvE. You must match up the filenames and other properties in exactness.

Using JavaScript to find and use objects is similar to finding a certain file in a certain folder on your computer. It uses a "path" format.

Example:

You have a file called "MyFile.txt".
It is in a folder called "Folder2".
The folder is located on your C drive.

To find the location of this file, the path would be
"C:Folder2MyFile.txt"

The same type of "path" system is used in JavaScript. It follows the path from the largest area and narrows down to a specific area or object.

As with most language commands, JavaScript follows it's own basic rules and formats. JavaScript can perform automatic functions of calculation to create a more interactive web site.

To get the browser to recognize JavaScript code, we have to place the code within SCRIPT tags :

<script type="text/javascript">

</script>

In many tutorials, you will notice the use of the COMMENT tags within the SCRIPT tags.

<script type="text/javascript">
<!--

// -->

</script>

These comment tags are used to "BLANK OUT" the JavaScript from any browsers that are unable to view or display JavaScript. About 98% of my viewers DO have JavaScript capable browsers and have that option turned on, so it is a very small error reducing factor.

JavaScript comes in 2 varieties :
Auto script
Script that carries out a set of codes (known as a blocks) automatically without the need for visitor input or occurance.
Trigger script
Script that requires some visitor input or occurance to carry out a set of codes.



-----------------
Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission.




Articles

Auto & Trucks

Business

Computer & I'net

  ·General

  ·Apache

  ·CSS

  ·Database

  ·Hardware

  ·HTML

Javascript&DHTML

  ·Linux

  ·MySQL

  ·Operating System

  ·Perl / CGI

  ·PHP

  ·Programming

  ·Publishing

  ·Search Engines

  ·Software Problems

  ·SSI

  ·Tips & Tricks

  ·Utilities

  ·Web Design

Family

Food & Drink

Gardening

Health

Other

Pets

Psychology

Spiritual

Travel

Women

 Calculators

Capital gain




  Disclaimer | Privacy | Terms of useCopyright © 2004 Nice2know.com