Hi Richard,

On 12/22/05, Richard Pearman <[EMAIL PROTECTED]> wrote:
>
> In the hope that my hosting company will sort out encoding for SVGZ (if
> they
> don't I'll find another one when it comes up for re-newal), I decided to
> correct my Javascript so it works with Firefox.  It seemed that the main
> problem was in this function, which is used by pretty well all my
> mouseover,
> mouseout and click events:
>
> function getDoc(evt) {
> return evt.getTarget().getOwnerDocument()
> }
>
> Fortunately this is in an external file so Pressumably all I have to do is
> change it and most my JavaScript should work in Firefox.  As far I could
> make out from http://jwatt.org/svg/authoring/#asv-getters-and-setters, I
> should change it to:
>
> function getDoc(evt) {
> return evt.target.documentElement
> }
>
> However this gives me an error message in ASV and still doesn't work in
> Firefox.  Can somebody explain what the problem is?
>

No, not documentElement, it should be ownerDocument. In other words:

function getDoc(evt) {
  return evt.target.ownerDocument;
}

If you really want the documentElement then use something like:

function getDocEl(evt) {
  return evt.target.ownerDocument.documentElement;
}

Okay, I'll fess up. Although the principle (of removing the 'get') shown in
the authoring doc is right, I do have evt.target.documentElement which will
cause an error unless the event was dispatched to the document object.
Sorry, I'll change that now. :-)

Regards,
Jonathan


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

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

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