![]() |
steveclaflin.comObjectExaminer.js
|
---|
Currently freeware--licensed freely for use on your own system, but not for distribution to others.
The script has been tested in IE5+ and Firefox 1.5 with Windows 98 and Windows XP. I still consider this a beta release, pending further testing.
Version 0.82 fixed an issue in Firefox that one specific element is unexaminable - there may be other unexaminable elements that I haven't found yet.
ObjectExaminer is intended to be used in debugging JavaScript in web pages and for general exploring of the Document Object Model for a given web browser. It displays a table of the object's array elements and properties. Any item that is itself an object is hyperlinked so that it may be examined. You can get an example of how it works by clicking one of the following links:
To download: ObjectExaminer.zip (contains the js file and this page).
To use it:
<script src="ObjectExaminer.js">
examine(objectReference, 'objectName');
There are a number of variables you can set to customize the program (and/or thwart various browser inadequacies):
Variable | Assigned Value | Comments |
---|---|---|
arrayColor | 'FFFFEE' |
background color of Array Elements area |
arrayStyle | 'background-color:' + arrayColor + ';' | syle string for Array Elements area - customize this as you wish |
propsColor | 'FFEEEE' |
background color of Properties area |
propsStyle | 'background-color:' + propsColor + ';' |
style string for Properties area - customize this with whatever style properties you might want |
cellPadding | 3 | hopefully self-explanatory |
fontSize | '10pt' | used in style section for
td elements |
useStyle | true | use styles (see testNS4Style below) |
useBg
| false | use bgColor instead of styles (you should not set
both true , but could set both false ) |
testNS4Style | true | turns on test that sets useStyle false
and useBg true in NS4 (NS4 seems to have
problems with document.write and styles) |
NS4DocCloseDelay | 1000 |
delay time between document.write and document.close/finish up properties needed by window- apparently needed by NS4 (multi-window threading issue?) |
wTop | 0 | base location of popup windows |
wLeft | 0 | base location of popup windows |
cascade | 20 | amount by which to offset child window |
wShrinkW | 32 |
popup width = screen width - wShrinkW - accumulated cascade |
wShrinkH | 48 |
popup height = screen height - wShrinkH - accumulated cascade |
doSort | true |
enables sorting of props list - setting false will speed
things up in some browsers |
skipBadHrefs | true | works around a NS6 bug that hangs
up on host , hostname , and search with
certain protocols - set to false if your browser does not
exhibit this problem |
legalHrefs | 'http https news ftp file gopher' |
space-delimited string of non-problematic protocols |
Give it a try--I'd be interested in any feedback or suggestions you might have.