Home | Contact Us | Log In | Help
  ASP.Net & C#
  Perl and PHP
  Java Scripts
  C and C++
  Ajax Tutorials
  J2ee, J2Me, Java
  Python & Ruby Rail
  Crystal Report
  Cold Fusion & CFML
  Photoshop/Web Designing
  Tools & Utilities
  Sql Server
  Domain Name Registration
  Remotely Hosting
  Web/Server Application
  Hotel Marketing
  Internet and Law
   Search Engine Optimization/SEO
Interview Questions
Previous< 1 2 3 4 5 6 7 > Next
JavaScript Closures 101- they're not magic

Closures are not hard to understand once the core concept is grokked. However, they are impossible to understand by reading any academic papers or academically oriented information about them!

This article is intended for programmers with some programming experience in a main-stream language, and who can read the following JavaScript function

Event Handlers

Events are actions that occur because of user interaction. Using the car analogy given above one possible event is pressing the parking brake pedal which would use the apply_parking_brake() method and perhaps others such as turn_brake_indicator_on() and turn_running_lights_off(). In computing, user events (like moving the mouse) or system effects (like a file completing loading) are common occurrences. JavaScript can use event handlers to initiate some process such as checking for valid information in a form by calling a function. To see the list of possible actions that you can program for by using event handlers.

The Document Object

As was mentioned, document is a part of the Document Object Model. We saw a method that can be used with document, but here's a couple more (Properties and Methods).


The prompt box syntax is: prompt("yourtext","defaultvalue");

The user must click either "OK" or "Cancel" to proceed after entering the text.

Typical use is when the user should input a value before entering the page.

Examples could be entering user's name to be stored in a cookie or entering a password or code of some kind.

- If the user clicks "OK" the prompt box returns the entry.
- If the user clicks "Cancel" the prompt box returns null.

What's the difference between JavaScript and Java?

Actually, the 2 languages have almost nothing in common except for the name. Although Java is technically an interpreted programming language, it is coded in a similar fashion to C++, with separate header and class files, compiled together prior to execution. It is powerful enough to write major applications and insert them in a web page as a special object called an "applet." Java has been generating a lot of excitment because of its unique ability to run the same program on IBM, Mac, and Unix computers. Java is not considered an easy-to-use language for non-programmers.

previous< 1 2 3 4 5 6 7 > Next
  Copyright 2000-2006 © SoloScript.com, All rights reserved.