W3C home > Mailing lists > Public > www-svg@w3.org > November 2001

embed vs. object, interacting with the dom from html

From: <Paul.Asman@ny.frb.org>
Date: Fri, 16 Nov 2001 14:29:38 -0500
Message-Id: <200111161927.OAA21422@p1fed4.frb.org>
To: www-svg@w3.org
I'd appreciate any insight into this. I have a number of SVG images
embedded in HTML pages. I used the 'object' tag for these, for all the
right (standards-following) reasons. Until recently, I was able to changes
these images with calls from the HTML. Recently, that stopped working.
Here's what happened.

I had this object:
     <object data="cscByHand.svg" name="theSVG"
          height="625" width="200" type="image/svg">
     </object>

I then got hold of it with this:
          var SVGDoc = null;
          SVGDoc = document.theSVG.getSVGDocument();

After an upgrade to version 3.0 of the Adobe viewer, this stopped working,
so I changed the type to "image/svg+xml". I also updated the MIME type on
the iPlanet Web Server 4.1 accordingly. The change worked for static SVG
images, viewed in IE 5.5. However, the server returned an error when I
tried to get hold of the document as above. Sometimes, I got an unknown
error message from the browser, other times a message that the method was
not supported. Working from the latter, I tried substituting 'embed
["theSVG"] and embed[0], to no avail. Oddly, the method call continued to
work if the HTML was opened as a page through the 'file open' option.

When I changed the tag to 'embed', though, the call worked. This is the
substitution:
     <embed src="cscByHand.svg" name="theSVG"
          height="625" width="200" type="image/svg+xml">
     </embed>

Since things are once again working, I don't have a problem to be solved.
But I'd sure like to know what's going on.

Paul Asman
Federal Reserve Bank of New York
paul.asman@ny.frb.org
Received on Friday, 16 November 2001 14:31:03 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:21 GMT