PDA

View Full Version : force object's path display


bluephoenix
02-03-2003, 07:00 AM
I'm stumped; it's late and I've been at this for hours trying everything I can think of. Here's what I've got. I have the following function call assigned in my html document:

onMouseOver="showPath(this); return true;)

the function resembles:

function showPath(mousedItem) {
var whereAmI = mousedItem.???
document.title = whereAmI;
}

I need to know what to use in place of the ??? to have the path of the item displayedin the titlebar. For example, the desired output would be similar to window.document.object.name

Thanks for the help. It seems simple, but I just can't figure it out.

joh6nn
02-03-2003, 07:45 AM
i don't think there's anyway to do that.

bluephoenix
02-03-2003, 02:16 PM
NO!?! QUICK!! SOMEBODY CALL THE W3!

... not that Microsoft or Netscape would listen to them anyways.

caldasgsm
02-03-2003, 02:49 PM
well I presume you want the DOM path rigth... well it should be something like this

function showPath(mousedItem)
{
var path='';
for(obj = mousedItem;obj.tagName != 'BODY';obj = obj.parentElement)
path = '->' + obj.tagName + path;
document.title = '->BODY' + path;
}

Hope it helps....