Entry
How do you display object properties in a pop up window?
Apr 10th, 2001 03:19
Alex Fenton, Dee Syms,
Try this function -
function popUpProperties(inobj) {
op = window.open();
op.document.open('text/plain');
for (objprop in inobj) {
op.document.write(objprop + ' => ' + inobj[objprop] + '\n');
}
op.document.close();
}
then call it from anywhere, passing it a reference to any Javascript
object.
e.g.:
// show an input element's properties when it's clicked
<input type="button" name="whatever" onclick="popUpProperties(this)">
// show all the properties for the document when a link is clicked
<a href="javascript:popUpProperties(document)">my link</a>
alex fenton 10/04/2021