Basic Intro to Javascript


Unix Tools
unix tutorials, unix security, unix help

 

New to javascript? Not sure how it relates to anything at all? This article will get you started.

Keep in mind that Javascript has zero resemblance to Java, dispite the similarity in the names. It's not a watered down Java, it's a different critter entirely. In a nutshell Javascript drives a lot of the interesting, sometimes annoying, things that happen on websites, such as generating pop-ups. On the home page of this site you'll see three newsfeeds. Two of those, LinuxWorld and Digg, are javascript driven (the other is PHP.)

An Introduction to Javascript  

by Jim Pretin

If you are creating a web site for the first time, then you probably have some knowledge of the HTML programming language. HTML is a fairly simple language to learn, and most beginning web designers are usually self-taught when it comes to using HTML to create a simple site. HTML provides the style, structure, and formatting for a web site.

However, HTML does not actually do anything. It is a static programming language. It does not process anything or make your site interactive, it just sits there and tells the browser how the site should look.

[Various other methods of making content more dynamic, flexible, and interesting have poped up as well (pun intended.) CSS for layout, DHTML for things lake fancy menus, and so on. -UT]

So, other programming languages have been created to not only improve site design, but to validate forms, establish cookies to make sites easier to use, and to react to input received from the user.

One such language, perhaps the most important and widely used non-static programming language, is called Javascript. Javascript, contrary to its name, has virtually nothing to do with the Java programming language. Javascript is a scripting language.

Scripting languages are used to connect diverse pre-existing parts to accomplish a new related task without compiling. Instead, scripting languages are interpreted, and are executed faster than a compiling language. Javascript is very versatile and can communicate with other languages effectively. Javascript is a registered trademark of Sun Microsystems, and is compatible with every major browser on the market.

Javascript is most often used to handle certain events that might take place as the user interacts with the web page. For example, if the user is filling out an online form on the site and enters invalid information into one of the form fields, then javascript can be programmed into the website to check the validity of the input before the form is submitted. If the input is invalid, the script can be used to prevent the form from being submitted and to tell the user what needs to be corrected.

Javascript, when used, is ordinarily inserted in the head section of the web page. In the head section, the programmer can create certain functions that can be executed if that function is called upon somewhere in the body section of the page.

Using the form example once again, if there is an HTML form somewhere on the page, the programmer may want to create a Javascript function to insure that the user enters his or her last name before the form can be submitted. To accomplish this, the function must be inserted in between the opening and closing head tags of the web page.

Then, the function must be called upon within the form tag of the HTML form. When the user tries to submit the form, the form tag calls upon the Javascript function in the head section to make sure that the last name has been entered. If the last name was omitted, then the submission is halted and the user is told to enter his or her last name before submitting the form.

Like any mathematical function, Javascript functions also make use of variables and arithmetic operators. The logic of Javscript functions is often created using if/then statements so that if a certain condition exists, then a certain reaction or output will result. Uses for these functions include form validation, enabling cookies, displaying certain images when the user performs a certain action, and detecting what kind of web browser the user has, so that the style of the web page can be instantly adjusted to accommodate that particular browser.

Javascript is actually a fairly easily language to learn, because it is very logical and the syntax is not complicated. Even if you have never used Javascript before, you can learn it fairly easily by searching for tutorials on any major search engine. Using Javascript will bring your static HTML web pages to life.

About the Author

Jim Pretin is the owner of http://www.forms4free.com/, a service that helps programmers make email forms.

Javascript Resources:

One of the ways to learn code, of course, is to look at examples. With javascript there are thousands of sites that have free code samples, tutorials, tips, and more. For example, the W3schools site has a nice tutorial, with many examples, that will take you from "what the heck is javascript" level to writing full programs.

Webteacher has another javascript tutorial that's written for the total non-programmer. This means that everthing is written in English, not geek jargon. This one takes you step by step and explains a few backgrouind ideas, as well.

EchoEcho has a javascript tuturial that can be taken step by step or used as a quick reference.

Del.icio.us Javascript

IBM Announces Services to Migrate Clients to the IBM System z for ... - MarketWatch

IBM Announces Services to Migrate Clients to the IBM System z for ...
MarketWatch- 16 minutes ago
For instance, IBM has helped nearly 1200 customers migrate from competitive Sun, HP and other UNIX platforms to IBM's AIX or Linux on Power. ...

Force10 Networks Supports Emerging Requirements in Network ... - Business Wire (press release)

Force10 Networks Supports Emerging Requirements in Network ...
Business Wire (press release),CA- 8 hours ago
"Based on a Unix-like kernel, the Force10 operating system provides businesses the flexibility to optimize network operations while streamlining management ...

VMware testing data center OS for managing, literally, everything - Computerworld

VMware testing data center OS for managing, literally, everything
Computerworld,MA- 17 hours ago
Most other large companies and many mid-sized firms also have environments that include RISC-based servers, Unix operating systems and midrange systems ...

SSH Tectia Certified With RSA Secured Partner Program - Earthtimes (press release)

SSH Tectia Certified With RSA Secured Partner Program
Earthtimes (press release),UK- 10 hours ago
SSH Tectia products provide transparent, strong encryption and authentication, and are available for all key enterprise platforms including Windows, Unix, ...

Aurora Opens Southeastern US Office - PR Web (press release)

Aurora Opens Southeastern US Office
PR Web (press release),WA- 12 hours ago
... ethical hacking tests and network reviews covering firewalls, Unix, Windows NT, Novell networks, Web servers, Internet connectivity, and SAP security. ...

CodeWeavers Package Google Chrome For Linux and Mac - Slashdot

CodeWeavers Package Google Chrome For Linux and Mac
Slashdot- 10 minutes ago
Wine is an Open Source implementation of the Windows API on top of X, OpenGL, and Unix. While perfect windows compatibility has not yet been achieved, ...

Financial Medical Standardizes on SonicWALL Technology for Its ... - MarketWatch

Financial Medical Standardizes on SonicWALL Technology for Its ...
MarketWatch- Sep 9, 2008
"We now have about 40 people remotely accessing both Windows and UNIX resources over the SSL VPN," said Marra. "They get authorized on before they even go ...

CCIE Security Written Exam #350-018 - indiainteracts.com

CCIE Security Written Exam #350-018
indiainteracts.com,India- Sep 9, 2008
What do the output of Windows and Unix networking and security commands look like? What do output of router IOS security and status commands look like? ...

Amanda Wins InfoWorld's BOSSIE Award for Best Network Backup Software - Business Wire (press release)

Amanda Wins InfoWorld's BOSSIE Award for Best Network Backup Software
Business Wire (press release),CA- 8 hours ago
Amanda has been chosen as the best open source network backup software for its extensive support of heterogeneous platforms, layered security and its ...

Isilon and Open Text Connectivity Solutions Speed Enterprise ... - Earthtimes (press release)

Isilon and Open Text Connectivity Solutions Speed Enterprise ...
Earthtimes (press release),UK- 10 hours ago
However, NFS has traditionally been a Unix-oriented protocol, preventing Windows environments from leveraging its performance and security characteristics ...

Javascript on Amazon:


UNIX
Unix Tools
Site Map
Unix Tutorials
Perl, CGI, C, C++ tutorials
What is CGI?
Perl Basics
PHP Introduction
Basic HTML Tutorials
HTML Codes and Basics
HTML Codes 2
Basic Intro to Javascript
Java tutorials
SQL Tutorials
Unix Primer
UNIX HELP
Unix Help
AIX Unix
IRIX
DG/UX
Digital
HP-UX - HP Unix
Sun Server
Unix for PCs
SUSE Linux Enterprise 10
SUSE Linux Enterprise 9
Linux Runlevels
SECURITY
Unix Security
Unix Network Security
Unix Account Security
Unix File System Security
Unix Security Testing
Unix Security Websites
Unix Security Checklist
Hardware Vendors
Unix Software
Unix Training
Veritas Clusters
About Us
WebMasters
Promote Your Website
Submit Your URL
How to Build a Website, Step by Step
Deal of the Day
Other
Directory
Other Resources
Software
The Modern Geek
Articles
Contact UnixTools
Qassia