A Workaround to That MS Update
As you have probably read elsewhere (e.g. Tom Gilmore, Jeffrey Zeldman, WaSP, What Do I Know), Microsoft have revealed how they are going to cripple their browser in an attempt to avoide infringing the patent that they have already been sued a cool $500m+ for. There is developer documentation already available out there - Apple have already provided the following:
- Creating the Best User Experience for Active Web Content
- Authoring Websites for Compatibility with Internet Explorer for Windows FAQ
- Preparing Websites with Active Content for Upcoming Changes to Internet Explorer for Windows
One of the recommendations is to use an external script to write the <embed>
tag - this is quite common practice anyway, normally for reasons of sniffing for the correct version of a plug-in and serving the appropriate content. However, others may need to convert plain old HTML into a script. And here’s where we can help …
First things first: putting anything into a <script>
block causes accessibility problems - what if scripts are turned off? What if the browser does not support scripting? Well, I take a pragmatic approach - that being that the majority of content that would be linked in this manner is likely (but not certain) to be largely inaccessible anyway. If this does not ring true to you, I apologise. But if we take it that we’re looking at embedding Flash, it’s highly unlikely to be fully accessible. I won’t run through all the reasons why here - let’s get to the point!
If you do decide to embed an external file such as a Flash movie, and you do decide to use a <script>
block to do that, be sure to make proper use of the <noscript>
element. But hey, you knew that anyway, right?
Anil Dash writes today: “I’d guess most companies will start seeing a rash of error reports (”Why do I get a popup on your site?”) around January, and then they’ll want to start moving all their OBJECT tags to javascript document.writes. Macromedia’s announced that they’ll be creating a tool to automate this, I assume Microsoft will as well, and it would seem likely for Real and Apple’s QuickTime group to follow suit.”
Well, there’s already one such tool available on this very site - HTML to JavaScript convertor.
As an example, here’s a before-and-after, performed simply by copying/pasting and pressing one button:
<OBJECT CLASSID="yahtzee.py" CODETYPE="application/x-python" STANDBY="Ready to play Yahtzee?" TITLE="My Yahtzee Game">
</OBJECT>
<OBJECT CLASSID="java:Yahtzee.class" CODETYPE="application/java" WIDTH=400 HEIGHT=250 STANDBY="Ready to play Yahtzee?" TITLE="My Yahtzee Game">
</OBJECT>
<OBJECT DATA="yahtzee.gif" TYPE="image/gif" TITLE="A Yahtzee animation" WIDTH=200 HEIGHT=100>
Yahtzee is my <EM>favorite</EM> game!
</OBJECT>
Gets converted to:
<script language="JavaScript" type="text/javascript">
<!--
function writeJS() {
var str='';
str+='<OBJECT CLASSID="yahtzee.py" CODETYPE="application\/x-python" STANDBY="Ready to play Yahtzee?" TITLE="My Yahtzee Game">';
str+='<\/OBJECT>';
str+='<OBJECT CLASSID="java:Yahtzee.class" CODETYPE="application\/java" WIDTH=400 HEIGHT=250 STANDBY="Ready to play Yahtzee?" TITLE="My Yahtzee Game">';
str+='<\/OBJECT>';
str+='<OBJECT DATA="yahtzee.gif" TYPE="image\/gif" TITLE="A Yahtzee animation" WIDTH=200 HEIGHT=100>';
str+='Yahtzee is my <EM>favorite<\/EM> game!';
str+='<\/OBJECT>';
str+='';
document.write(str);
}
writeJS();
//-->
</script>
It’s a basic tool, admittedly, but it may be useful for some. I leave you to decide.