>From my understanding that should work, and in some browsers it does.
To make it work in the other browsers too you could try it with

window.addEventListener("click", click, false);

or

document.documentElement.addEventListener("click", click, false);

Might be they don't both work the same way (if they do work, that is)
when clicking on an area of the window in which nothing is. In that
case you would have clicked on the window but not on any visible child
element of the root element. At least it seems reasonable to me that
this would dispatch the event on the window object but not on the
rootElement. I'm not sure if browsers consistently implement it this
way though.


Hope this helps.
Regards
    Frank

--- In svg-developers@yahoogroups.com, "Kristien Ooms"
<[EMAIL PROTECTED]> wrote:
>
>  Hi all,
> 
>  
> 
> I have a problem with the addEventListener-code for javascript. I
want to
> attach an eventlistener to
> 
> my svg-document; this way I want to register if the user clicks
anywhere in
> the window. 
> 
> I have an svg-document with a link to an external js-file. In that file
> there is the following code:
> 
>  
> 
> alert(document);
> 
> document.addEventListener("click",click,false);
> 
>  
> 
> the alert message tells me "[object SVGDocument]", so it is indeed the
> correct document I wanted.
> 
> But then I get an error message "object doesn't support this property or
> method".
> 
> So my question, can I add an EventListener to  the svg-document or
is this
> not allowed?
> 
> Is there maybe another way to achieve this registering of clicks
(while the
> user watches an svg document)?
> 
>  
> 
> Kristien
> 
>  
> 
>  
> 
> 
> 
> [Non-text portions of this message have been removed]
>



------------------------------------

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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/

Reply via email to