« The End of Gerrymandering | Main | HTML House of Horror: Things That Go <BLINK> in the Night »
"Rest assured, I was on the Internet within minutes, registering my disgust throughout the world."
So far, this week has not been a great week, technology-wise.
First, this week's award for Kookiest Third-Party Documentation goes to JUnit.org, for their rather creative Javadoc description for TestSuite.createTest(). Umm, guys, the traditional we-don't-give-a-rat's-ass-about-our-Javadoc Javadoc would have been something like, "TestSuite.createTest(): Creates a test." Better to be random and pointless than simply pointless, I suppose.
Second, a special shout-out to Dell for designing their hardware such that you can't buy 3rd-party memory. Let's see, $210 for two sticks of PC100 RAM.[1] At least now my system can handle amazing feats of computational wizardry... such as running Netscape and FrameMaker at the same time.
But the real winner of this week's sweepstakes is the <object> tag. The problems with this tag are well-known. Yes, it has terrible support in modern browsers. Yes, it is the only replacement for the <img> tag in XHTML2... still. And no, the situation is not going to improve significantly until about the year 2006. But you've heard about all that. I'd like to share with you my particular episode of <object> tag pain.
The trouble started when I decided to play around with SVG. I dutifully downloaded the Adobe SVG plugin, and soon I was off to the races.
So how do you embed SVG in a web page? In theory, you could do it inline... if you served up a pure XHTML page with the right MIME-type, and a carefully constructed DOCTYPE, to the right browser, on every third Sabbath after Simchat Torah. But even the foolhardy don't bother with this strategy. No, the accepted method uses the <object> tag, like so:
<object type="image/svg+xml" data="/path/to/image.svg"
width="400" height="400">
<img src="/path/to/image.gif" width= "400" height="400"
alt="description" />
</object>
The <object> tage embeds the SVG image, while the old-fashioned <img> tag provides a fallback GIF image for older browsers. Elegant, right? Only problem is that this markup crashes my copy of Safari every single time.
The problem is with the type attribute, which specifies the MIME-type of the SVG file. If the attribute is present, Safari crashes. If you delete it, Safari works just fine, but IE 5.2 for Mac no longer displays the object. Apparently IE5.2 needs the MIME-type explicitly defined. (This might also be the case for IE/Win, but I haven't tested this yet.) Note that both browsers have interesting and quirky behavior. Safari is perfectly happy to display the SVG image if there is no type attribute at all or a totally made-up value (such as "foo/bar". However, a wrong MIME-type ("text/html") causes Safari to A) not display the image and B) bring a Finder window to the foreground. (?!) IE5.2, on the other hand, refuses to display the object if the attribute is absent or if the MIME-type is totally made up... but it does display the image if you provide any MIME-type that it understands, such as text/html. Meanwhile, Mozilla displays the image in all circumstances.
But don't fret! You know what works for all three browsers, every single time, with no crashing or quirks whatsoever?
<embed src="/path/to/image.svg" width="400" height="400">
Yeah, I need a drink too.
1. Seriously, who do these Dell guys think they are? Apple?
Posted by Evan Goer on Oct. 21, 2003 at 9:37 PM | Comments (19)
The basics:
http://www.yahoo.com automatically become links.This entry was posted on October 21, 2003 by Evan Goer.
For more entries, you can visit the main journal page or browse through the complete archives, which date back to 2001.
Text released under Creative Commons.
To use this license, you must attribute this work properly. This license does not extend to comments unless the original poster of that comment states otherwise.
Powered by Movable Type 3.33.
Home | About | Journal | HTML Tutorial
© Copyright 2001-2007, Evan Goer. Some Rights Reserved. Last Updated July 2, 2008.
Posted by Jacques Distler on Oct. 21, 2003 at 11:27 PM
Posted by Evan on Oct. 22, 2003 at 12:08 AM
Posted by jgraham on Oct. 22, 2003 at 1:06 AM
Posted by Jim Ley on Oct. 22, 2003 at 5:14 AM
Posted by Jacques Distler on Oct. 22, 2003 at 5:40 AM
Posted by Jacques Distler on Oct. 22, 2003 at 5:53 AM
Posted by Evan on Oct. 22, 2003 at 8:56 AM
Posted by Anne on Oct. 22, 2003 at 10:49 AM
Posted by Danny on Oct. 22, 2003 at 12:16 PM
Posted by Evan on Oct. 22, 2003 at 2:34 PM
Posted by Jacques Distler on Oct. 22, 2003 at 3:50 PM
Posted by Mike Kozlowski on Oct. 23, 2003 at 9:15 AM
Posted by Anne on Oct. 23, 2003 at 10:30 AM
Posted by Evan on Oct. 23, 2003 at 1:38 PM
Posted by jgraham on Oct. 23, 2003 at 3:42 PM
Posted by Jimmy C. on Oct. 24, 2003 at 12:47 AM
Posted by Jimmy C. on Oct. 24, 2003 at 12:49 AM
Posted by Adiv on Oct. 24, 2003 at 1:22 PM
Posted by Jacques Distler on Oct. 24, 2003 at 2:13 PM