It works on my computer the same way in both FF1.5 and IE6. Do you have the
Adobe Plugin installed for Firefox?

 

Geoffrey J. Swenson

[EMAIL PROTECTED]

 

-----Original Message-----
From: svg-developers@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Greg Mercer
Sent: Sunday, December 11, 2005 7:25 PM
To: svg-developers@yahoogroups.com
Subject: [svg-developers] Scripting from HTML to SVG

 

Hi All,

I was trying the following example, on FireFox 1.5, using Adobe SVG
Viewer 6.0 - I've set the svg.enabled to false using about:config.

http://jwatt.org/svg/demos/scripting-across-embed.html

It has the following code that attempts to get the "svg window"
object, so that it can call into svg script functions from the html file.

Under this enviroment, all these attempts to get "window" fails. See
svgwin below. 

Is there any way around this?

Thanks,

Greg

..

var svgdoc = null;
var svgwin = null;

function init()
{
  // FIRST WE TRY TO OBTAIN A REFERENCE TO THE SVG DOCUMENT.
  //
  // Mozilla with native SVG support and ASV running in IE both
support the
  // GetSVGDocument interface for the <embed> object.
  //
  //   http://w3.org/TR/SVG11/struct.html#InterfaceGetSVGDocument
  //
  // Unfortunately ASV in IE doesn't allow us to check if the method
  // getSVGDocument() exists without calling it. Since calling a
function that
  // doesn't exist will cause an error we must be prepared to catch an
  // exception.

  var embed = document.getElementById('embed');
  try {
    svgdoc = embed.getSVGDocument();
  }
  catch(exception) {
    alert('The GetSVGDocument interface is not supported');
  }

  // If the GetSVGDocument interface is supported then the global variable
  // svgdoc will now contain a reference to the SVG document.
Otherwise it will
  // be null.
  //
  // NOW WE TRY TO OBTAIN A REFERENCE TO THE SVG DOCUMENT'S "window"
OBJECT.
  //
  // The W3C does not provide a direct way to obtain the "window"
object for
  // the SVG document from the <embed> element (obviously, since it's
not a W3C
  // tag). The W3C way to access the SVG document's "window" object is
via the
  // SVG document itself, using the defaultView attribute of the
DocumentView
  // interface.
  //
  //  
http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-DocumentView
  //
  // ASV in IE doesn't implement the W3C's DocumentView interface
(yet), so we
  // also try to access the SVG document's "window" object using the
non-W3C
  // standard properties 'window' and non-W3C standard function
getWindow() on
  // the <embed> object. Again ASV doesn't allow us to check whether
getWindow()
  // is supported, so we need to be ready to catch an exception if
calling it
  // causes an error.

  if (svgdoc && svgdoc.defaultView) {  // try the W3C standard way first
    svgwin = svgdoc.defaultView;
  } else if (embed.window) {
    svgwin = embed.window;
  } else try {
    svgdoc = embed.getWindow();
  }
  catch(exception) {
    alert('The DocumentView interface is not supported\r\n' +
          'Non-W3C standard methods of obtaining "window" also failed');
  }

  // If we failed to get a reference to the SVG document's "window"
then svgwin
  // will still be null.
}







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

 

*        Visit your group "svg-developers
<http://groups.yahoo.com/group/svg-developers> " on the web.
  
*        To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
  
*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of
<http://docs.yahoo.com/info/terms/>  Service. 

 

  _____  



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



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/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