[kde-linux] Konqueror 3.4.2.: For a window.event, both target.id and srcElement.id are undefined (was Re: Javascript statement: visible=(obj.style.display=="block"); problem in Konqueror 3.4.2)

Randy Kramer rhkramer at gmail.com
Tue Jul 10 02:48:53 UTC 2007


On Monday 09 July 2007 02:06 pm, Randy Kramer wrote:
> function Toggle(e) {
>   if (!document.getElementById) return;
>   if (!e) var e = window.event;
>   whichlink = (e.target) ? e.target.id : e.srcElement.id;
>   obj=document.getElementById(whichlink+"menu");
>   visible=(obj.style.display=="block");

I've gotten a little further.  By adding a document.write line just before the 
whichlink line, I've found that neither e.target.id nor e.srcElement.id are 
defined.

I guess I should mention that Toggle is called as follows:

document.getElementById("products").onclick=Toggle;

Any hints?

Randy Kramer



More information about the kde-linux mailing list