Wednesday, March 29, 2006 - Posts

Workaround for IE7 object activation

Microsoft is changing the way ActiveX controls, and pretty much anything that offers a user interface inside the web browser, can be interacted with. This is mainly to avoid paying patent whores such as Eolas hundreds of millions of dollars for something they did not invent in the first place. Normally I would moan about a change such as this, but I applaud Microsoft for making this bold decision.
 
This change is already implemented in IE7, all IE6 users will automatically get this 'update' on the 11th of April 2006. Microsoft has posted a description of the changes and a workaround, but an easier solution is provided here.
 
 
Most of the approaches offered so far involve the use of DIV tags, innerHTML properties and a separate function for each object you want to insert. This is a mess so together with a friend, Balazs Molnar, I have come up with a simpler solution.
 
The first part of our solution is to create a single JavaScript file that contains the following function. We'll call this file createObject.js.
 
function createObject(objectDefinition)
{
    document.write(objectDefinition);
}

 
This function must be created in an external JavaScript file or it will not work. This must be one of the workarounds that invalidate the patent.
 
We can now insert any OBJECT, EMBED or APPLET element in our HTML code in almost the same way we did before. The only change is that we need to put a few extra quotes and a function call in our HTML.
 
... other HTML
  
  <script language="javascript">
   var objectDefinition = 
       '<object width="425" height="350">' +
       '   <param name="movie" value="http://www.youtube.com/v/jkqoPkuJaMI"></param>' +
       '   <embed src="http://www.youtube.com/v/jkqoPkuJaMI" type="application/x-shockwave-flash" width="425" height="350"></embed>' +
       '</object>';
   
   createObject(objectDefinition);
  </script>
 
... other HTML
 
The provided solution works fine in my copy of IE7b2  and is backwards compatible with IE6 as well as Firefox.
 
Check out this online sample of the method described here or download the code.
 
Alternative ways, all more complex than the solution offered here, are listed below.

Microsoft certified training for VS2005

I get enough traffic on this blog so maybe soeone can help me with the following:
 

 
All developers in my company need to qualify for all relevant .net exams. Some are starting on new exams but I would prefer it if they took the upgraded ones for VS2005.
 
Having looked at Microsoft's site it is not clear if these updated exams are available. Does anyone know if new versions of the following exams are avaialble?
  • 70–320: Developing XML Web Services and Server Components with Microsoft Visual C# and the Microsoft .NET Framework
  • 70–315: Developing and Implementing Web Applications with Microsoft Visual C#™ .NET and Microsoft Visual Studio .NET
Any help would be greatly appreciated.