JavaScript: Enumerating Properties of an Object with a For/In Loop

JavaScript object properties can be enumerated by using a for/in loop, as demonstrated below:
var objCar = new Object();
objCar.wheels = 4;
objCar.tires = 4;
objCar.engines = 1;
for (var i in objCar)
{
document.write(i);
document.write('<br/>');
}
The result of this code is:
wheels
tires
engines

How to Create an Object in JavaScript

An object can easily be created in JavaScript by creating a new instance of the native JavaScript Object class. Following this, properties can be assigned to it, as follows:
var objCar = new Object();
objCar.wheels = 4;
document.write(objCar.wheels);

JavaScript Instance Methods

A constructor that is created in JavaScript can have methods defined for it. These are called ‘instance methods.’
For example, suppose the following constructor was defined in JavaScript:
function Square(intSideLength)
{
this.sideLength = intSideLength;
}
In this example, ’sideLength’ is an instance property and each instantiation of the Square class will have it’s own copy of the ’sideLength’ property. Instance methods [...]

How to Enable and Disable JavaScript in Internet Explorer

JavaScript can easily be enabled and disabled in Internet Explorer through a check box that is found at the following location in Internet Explorer:

Click ‘Tools’ on the menu bar’
Select ‘Internet Options’
Click the ‘Security’ tab
Click the ‘Custom Level’ button
Scroll to the ‘Scripting’ section

Select ‘Disable’ to disable JavaScript
Select ‘Enable’ to enable JavaScript
Select ‘Prompt’ to be prompted whether [...]

What is a Mashup?

A mashup is a web application hybrid. Mashups take information from more than one source and combine it into one application. The combination of these multiple applications makes the mashup more useful collectively than the individual applications are themselves.
A common example of a mashup is a website that uses Google Maps within its site to [...]

How to Enable and Disable JavaScript in Mozilla Firefox

JavaScript can easily be enabled and disabled in Firefox through a check box that is found at the following location in Mozilla Firefox:

Click ‘Tools’ on the menu bar
Click ‘Options’ from the menu
Click on the ‘Content’ section in the pop up box
Click the ‘Enable JavaScript’ check box to enable JavaScript; remove the check in the box [...]

JavaScript Instance Properties

A constructor that is created in JavaScript can have properties defined for it. Each instantiation of the constructor has it’s own copy of the properties. These are called ‘instance properties.’
For example, suppose the following constructor was defined:
function Dog()
{
this.legs = 4;
}
From this constructor, two instances of the Dog class could be instantiated:
var myDog = new Dog();
var [...]

Ajax Polling

Ajax polling is when a browser makes an asynchronous request to a server at regular intervals to see if anything has changed on the server. When it is determined that a change has been made, the page can be updated accordingly.
For example, a page showing product information which includes quantity available, could be polling the [...]

JavaScript is an Object-Oriented Language

JavaScript is often considered to not be an object-oriented language. This stems from it not supporting inheritance through classes. JavaScript does use prototype-based inheritance, however. Prototypes make properties and methods of a constructor available to all instantiations of the constructor. These aren’t classes, in the strict sense of the word, but JavaScript is able to [...]

JavaScript Prototypes

In JavaScript, when a function is defined a property called prototype is automatically created. Properties and methods can be added to this prototype. Any properties or methods added to this prototype will be available to any instantiated instances of the function. The function is a constructor and therefore is similar to a object-oriented class.
For instance, [...]