Another way to get around ActiveX silliness

Written by on March 8th, 2007 in Ajax News.

Eric Anderson has written his own script to get rid of the annoying “Click here to activate” IE now puts on all ActiveX controls (including Flash).

There are other solutions such as UFO and SWFObject that we have discussed in the past.

JAVASCRIPT:

  1.  
  2. if (navigator.appName == “Microsoft Internet Explorer”) (function() {
  3.         var onload = window.onload || function(){};
  4.         document.body.setAttribute(’onload’, null);
  5.         window.onload = function() {
  6.                 onload.apply(this, arguments);
  7.                 var tags = [’object’, ‘embed’, ‘applet’];
  8.                 for( i=0; i<tags.length; i++ ) {
  9.                         var elements = document.getElementsByTagName(tags[i]);
  10.                         for(j=0; j<elements.length; j++)
  11.                                 elements[j].outerHTML = elements[j].outerHTML
  12.                 }
  13.         }
  14. })();
  15.  

Source: Ajaxian
Original Article: http://ajaxian.com/archives/another-way-to-get-around-activex-silliness

Leave a Reply

You must be logged in to post a comment.



Site Navigation