Debug Command Reference

Go to the


This module has just one command associated with it, and requires the user to make a call to a routine which displays information. It works best in version 5 or later browsers (except Opera 6). It will also work in Netscape 4.x. The purpose of this module is to allow the user to obtain information about internal variables of overLIB while it is actually working in order to assist in debugging situations where popups are not working as expected. To query variables within overLIB, just insert the following statement at the appropriate place within the overLIB code:

 showProperties(variable_label, variable, ...)

where variable_label is how you want to call the variable that is going to be dislayed (a string) and variable is the actual variable to display (type variable). For example, you may want to find out what the values of o3_x and o3_y are while moving the mouse around your page. Just insert the statement showProperties('o3_x', o3_x, 'o3_y', o3_y) just after these variables are set in the olMouseMove routine, as you can see by clicking here. The core module used on this page, overlib_vdbg.js, has a couple of calls to the showProperties() routine but is otherwise the same as overlib.js.

The showProperties routine can also be called in Netscape 4.x since, in v4.10 and later, the DIV container used to display information is automatically created. However, it is good practice to include the declaration statements within the document itself. Just after the BODY tag, add the statement:

 <div id="showProps" style="position: absolute; 
    visibility: hidden;"></div> 

(NOTE: there isn't any need to specify a z-index value, but you can include one if you want, because it will be set to a value higher than what's used for the overDiv container of overLIB). If the showProps container doesn't exist, this plugin will dynamically create the DIV container for you in all supported browsers. You can also define this container if you're using a version 5 or later browser, but it really isn't neccessary. When this container is dynamically created it is not permanently added to your document. There should not be any conflict with an overLIB popup since this container uses a z-index that is higher in value then what's used by the normal overLIB popup. At worse, the debug window may obscure your popup.

If you use this feature in Netscape 4.x with the Shadow plugin, a javascript error occurs when you try to enter a link for the second time. At present, an explanation why this error occurs isn't known but if you manually refresh your page it should go away. Also the debug display may flash on and off in Netscape 4.x, because it is continuously being rewritten and displayed.

You can have more than one container showing at a time. Just supply the ID of this container (a string value) as the first argument in the call to showProperties, as in showProperties(containerID, variable_label, variable, ...). Note, the presence of this parameter is determined by checking how many parameters are supplied to the call. A normal call will have only an even number of parameters since they must occur in pairs as label, value... etc. An odd number of parameters signals the routine that the first parameter is the containerID. You can see an example of this in action by first making sure that you've clicked the link above and then mouse over another link. To allow the user to see all of the popups (which are offset from one another horizontally), the layer ID has been made a link which when clicked will move that layer to the bottom of the stack and move the others upward. (I thank Fote Macrides for pointing out a logic error in implementing this feature and for his suggestion in correcting it.) You can also hide a layer by clicking on the X in the upper right-hand corner (see the discussion of the ALLOWDEBUG parameter below).

To include this support module just include the following statements in the HEAD section of your document:

<SCRIPT TYPE="text/javascript" SRC="overlib.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="overlib_debug.js">

You only have to make sure that the overlib_debug.js module is loaded after the core module.

Download this module as a zip file


Once a debug window has been closed it will remain hidden from view; however, it can be made visible again by using the following parameter on the command line.

Permits the specified debug layer(s) to become visible until closed again by clicking on the X in the upper right hand corner. The command value, debugID (a string value), is either a single name or a comma delimited list of names of debug layers. [Note: thanks go to Fote Macrides for catching this omission.] If a layer can't be found then nothing will be done. This command and its parameter value are ignored if used with the overlib_pagedefaults() command. There is no associated variable since the debug layers only become active during run-time.

Back to Top


Thank you for visiting - Come back again soon.