home / experts / javascript / column33 |
|
Version 4.0 of DOCJSLIB introduces many functions that expect the DHTML element to be passed by reference. What this means is that the object itself should pass to the appropriate function. This is in contrary to the older functions in DOCJSLIB that expect object ID to be passed as a string. You can check if the element is passed by reference or by string, by simply printing it to an alert box. The object passed by reference will be printed as an object, while the one passed by string will be printed as a string. Objects are created in JavaScript in various ways. A common one is to use the Let's take an example that shows the differences between call-by-reference and call-by-string. The function
The following function sets the visibility of elements that are passed by reference (objects):
|
Produced by Yehuda Shiran and Tomer Shiran
Created: January 4, 1999
Revised: January 4, 1999
URL: http://www.webreference.com/js/column33/callmodes.html