Re: [svg-developers] DOM references work in I.E. but fail in Mozilla Firefox

2005-01-25 Thread Jonathan Watt

Since Mozilla sticks to the W3C standards the way to access the
function defined in your SVG document from scripts defined in your
HTML document is to use contentDocument

http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177

on the HTMLObjectElement object followed by defaultView

http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-DocumentView

to access the global object (window) for the SVGDocument object like this:

svgObject.contentDocument.defaultView.setData(rs,date_start,date_end)

But then everyone knew that, didn't they?

-Jonathan


On Tue, 25 Jan 2005 20:33:13 -, tomilay [EMAIL PROTECTED] wrote:
 
 
 I have an SVG document with the outline below.
 
 svg xmlns=http://www.w3.org/2000/svg; width=690px height=480px
 viewBox=-50 -20 710 520  onload=initSVG(evt).../svg.
 
 When it loads it runs the initSVG(evt) function in the SVG document
 namespace which initializes a global variable in the same namespace to
 point to the SVG document object with this line
 
 svgDoc=evt.target.parentNode;.
 
 I am using the OBJECT tag to embed it in a HTML document as shown
 below.
 object id=svgObj type=image/svg+xml height=520 width=100%
 data=../xml/new_graph.svg
 /object
 
 I happen have the following function in the SVG document which should
 be invoked from the HTML document and shortly after the initSVG()
 function.
 
 function setData(arData,dt_start,dt_end)
 {
 // This initializes the global array rs
 rs=arData;
 date_start=dt_start;
 date_end=dt_end;
 
 spacing=Math.round(1/((date_end-date_start+MILLISEC)/MILLISEC)*sizeX);
 }
 
 Execution of this function from HTML is dependent on access to the SVG
 document DOM from the HTML document.  This is the approach I have used
 to try to achieve this outcome.
 
 body
 onLoad=svgObject=document.getElementById('svgObj'
 );...;svgObject.window.setData(rs,date_start,date_end);
 ...
 /body
 
 Problem:
 
 The approach works fine in I.E.  However Mozilla Firefox does not like
 the reference to svgObject.window.setData.  It comes back with Error:
 svgObject.window has no properties.  My interpretation is that this
 means that svgObject.window does not return a valid DOM object to the
 Firefox HTML engine.
 
 Has anyone encountered a similar problem?  Is there a different way of
 accessing the SVG DOM from Firefox?
 
 NB.I am using the ADOBE Svg viewer 6.0. Pre release version.
 
 Thanks in advance.



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





Re: [svg-developers] DOM references work in I.E. but fail in Mozilla Firefox

2005-01-25 Thread Jonathan Watt

On Wed, 26 Jan 2005 04:37:17 +, Jonathan Watt [EMAIL PROTECTED] wrote:
 Since Mozilla sticks to the W3C standards the way to access the
 function defined in your SVG document from scripts defined in your
 HTML document is to use contentDocument
 
 http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177
 
 on the HTMLObjectElement object followed by defaultView
 
 http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-DocumentView
 
 to access the global object (window) for the SVGDocument object like this:
 
 svgObject.contentDocument.defaultView.setData(rs,date_start,date_end)
 
 But then everyone knew that, didn't they?
 
 -Jonathan
 

Another way of doing this is to use the global 'parent' or 'top'
objects from a script in your SVG document to access the window object
for your HTML scripts and create a reference back to the SVG
document's window object.


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