Friday, March 8th, 2013

Calendar Generator

Creating a calendar to put into your web page becomes a whole lot easier if you use a server side script to generate the table tags for you. Here’s one that you can either build into your page to generate calendars dynamically or which you can alternatively use just to generate the HTML that you [...]

Tuesday, February 21st, 2012

Ways to Define a Function

JavaScript provides three ways to define functions. Here we look at the disadvantages that two of those ways have and the sorts of things that can only be done one way. Ways to Define a Function

Sunday, August 15th, 2010

Default Values for Arguments

Most programming languages have a really obvious way of assigning default values to function arguments for when that parameter is omitted. JavaScript has a not so obvious but far more flexible way of doing it. Default Values for Arguments

Thursday, July 22nd, 2010

How to Call a Function

Defining a function in JavaScript is rather useless if you don’t actually make use of the function. In this second tutorial on JavaScript functions we look at how to call the functions that we have defined. How to Call a Function

Thursday, July 1st, 2010

Function Libraries

In the seventh and last tutorial on JavaScript functions we look at an alternative way of being able to add sophisticated JavaScript functionality into web pages without having to write much code yourself by using a pre-written library that includes most of the functionality that you require. Function Libraries

Sunday, June 27th, 2010

Returning a Value

In this sixth introductory JavaScript tutorial on how to use functions we look at how you can return a value from the function that will be substituted into the calling code in place of the call. Returning a Value

Wednesday, June 16th, 2010

Same Function Different Variables

Continuing on the introductory JavaScript series about functions this third tutorial looks at how we can define arguments within the function so that we can pass different parameters to the function each time we call it rather than having the function access our global variables and hence always process the same variables. Same Function Different [...]

Sunday, June 13th, 2010

The Scope of Variables

The scope of a variable is the extent of the code in which the variable exists. For JavaScript variables defined within a function their scope is the function that they are defined in. Variables defined outside of functions as well as variables used without being first defined have global scope. The Scope of Variables

Saturday, June 12th, 2010

Optional Parameters

With JavaScript functions we don’t need to have a specific number of parameters to pass into a function. If we have situations where fewer parameters are required then we can set the JavaScript up to handle that simply by placing the mandatory ones first in the list and following them with the optional ones. JavaScript [...]

Friday, May 21st, 2010

How to Define a Function

The start of another series of introductory JavaScript tutorials. This one introduces the concept of functions and how to define them in JavaScript. How to Define a Function