Re: closure and multiple frames

Pavel Dudrenov <[email protected]>
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
This is wrong:

function clickFix() {

       printResponsibilities(this.index);
}

The this keyword might not be what you think it is. Not all browsers
pass this as the element on a event. This should work though:

function clickFix(e) {
       var srcEl = window.event?window.event.srcElement:e?e.target:null;
       while(srcEl && !srcEl.index) srcEl = srcEl.parentNode;

        if(!srcEl) return;

       printResponsibilities(srcEl.index);
}

Also change the .index property to some other name there might be an
element that already has index property.

Hope that helps,
Pavel


On 12/9/05, Scott Sauyet <[email protected]> wrote:
> bennybobw wrote:
> >     newAnchor.onMouseClick= clickFix;
>
> I don't have time to look closely, but this might be the issue.  The
> Javascript event is not "onMouseClick" but just "onclick".
>
> Good luck,
>
>    -- Scott
>
>
>
>
> Unsubscribe
> [email protected]
>
> List info
> http://www.quirksmode.org/dom/list.html
> Yahoo! Groups Links
>
>
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/9rHolB/TM
--------------------------------------------------------------------~-> 

Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wdf-dom/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.