Category: Top » Internet » Web-design »


Author: acbuddy | Total views: 1 Comments: 0
Word Count: 649 Date: Fri, 30 Nov 2007 6:49 AM

An Introduction to Javascript

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. 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. Then, 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.




Rate, comment or bookmark this article

Seed Newsvine

Rating: Not yet rated

Bookmark this article in your preferred program
AddThis Social Bookmark Button

Comments RSS

No comments posted.

Add Comment

Your Name:


Your Email:


Comment

Enter the code shown

Visual CAPTCHA



Popular Articles in this cathegory

1: Really Bad Beginner Website Design Mistakes
Avoiding all the common website design mistakes ahead of time will definitely help your site in the end. If you've never built a website on your own, I hope the tips here help you design the best site that you can and help you to avoid all these bad website design issues in the future.

2: The Important Keys To Successfull Website Design
The golden rules to design a better website for your product or company.

3: Getting The Best From Drupal Content Management Systems
Drupal is one of the most popular content management systems used across the web. It seems the popularity of the Drupal content management system grows by the day, too.

4: Outsourcing Website Design or Software Development Common Problems To Avoid
Have you heard someone talking about difficult scenarios relating to outsourcing their software development? Hearing such stories can make you wary about outsourcing your own projects. After all you do not want the headache of difficult programmers or those that do not complete the job on time.

5: Top Software Programs For Web Site Design
Adobe Dreamweaver 8 is the darling of the professional web design community for its powerhouse features, including powerful support for Cascading Style Sheets (CSS) and all major scripting languages.


Creative Commons License
This article is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.
Spanish taslation