Mozilla.com


Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. Parameters
  4. 4. Description
  5. 5. See also

__defineSetter__

Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. Parameters
  4. 4. Description
  5. 5. See also

Non-standard

Summary

Binds an object's property to a function to be called when an attempt is made to set that property.

Syntax

obj.__defineSetter__(sprop, fun)

Parameters

sprop
a string containing the name of the property to be bound to the given function
fun
a function to be called when there is an attempt to set the specified property. This function takes the form
function (val) { . . . }
val
an alias for the variable that holds the value attempted to be assigned to prop

Description

The __defineSetter__ method allows a setter to be defined on a pre-existing object.

Languages

Page last modified 18:19, 13 Feb 2009 by Sevenspade

Tags:

Files (0)