Understanding Events in JavaScript

What is a a JavaScript event? Any action that triggers the execution of JavaScript program code is called a JavaScript event. Events are usually triggered by the web users. For example, clicking the mouse is an event, dragging the mouse over a hyperlink is also an event. There are three categories of events or rather event handlers in JavaScript, namely events associated with forms, events associated with links and events associated with windows.

Read On…

 

 

JavaScript Objects in a Nutshell

Objects are  tools that JavaScript uses to carry out 99% of its jobs. For examples, JavaScript uses the Document object to present something on a webpage via its write and writeln methods, uses the Math objects to perform mathematical calculations, uses the Form object to accept input from the user and to validate data, uses the  various string objects to manipulate text and more. To learn more about JavaScript objects, please refer to the following lessons in our tutorial:

  1. Date Object
  2. Math Object
  3. String Object
  4. Document Object

Understanding JavaScript Functions

What is function in JavaScript? A function is a type of program, or part of the program, that can be called from the main JavaScript program to perform certain tasks. We can also define a function as a module of the main JavaScript program. A professionally written JavaScript program usually consists of numerous functions. It is easier to construct , debug and maintain a large program that make up of smaller modules, because the programmer needs only debug a module or modules if certain errors occur, instead of having to search for the whole program and trying to locate the error code.

There are two kinds of functions in JavaScript , the built-in functions and the user-define functions. Built-in functions are also known as methods that are tied to certain objects. For example, functions that are tied to the Math object are round, pow and more. There are also string manipulation functions, date and time functions and many more,  please refer to our previous lessons for more information on these functions.

Read On……

 

Dealing with Document Object in JavaScript

Document object in JavaScript is one of the most commonly used objects. The main purpose of the document object is to write something to the web page, or more appropriately is to display text content on a web page. The document object also holds all the information contains in a web page, such as its  background color, foreground color, its title , the date the web page was last modified and more. It can be used to customize webpages.

Read On…….

 

What is the String Object in JavaScript?

String object in JavaScript is used to manipulated texts and characters. For example, it can be used to process names, addresses, cell phone numbers, ID, company names, product codes, serial numbers and more. In fact, strings are considered the building block of the JavaScript program, because the program statements or instructions comprise strings and characters.

A string is made up of letters , numbers and alphanumeric characters such as #,@,$,!,&,*,\,+,- and more. Similar to the objects mentioned in previous chapters, the string object also operates using various methods.

Read On…….