Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE7 object fix

Status
Not open for further replies.

glenmac

Technical User
Joined
Jul 3, 2002
Messages
947
Location
CA
I found this in another forum and thought it might be usefull to my friends here.
Sooner or later we're all going to have to deal with the incredibly annoying consequences of the Eolas case, which has resulted in IE 7 and later 'upgrades' of IE6 requiring the user to click on every piece of embedded content on a webpage in order to 'activate' it for use, and in some cases having to negotiate a pop-up message asking them if they want to download the content. This has to be done every time the page reloads, too. The workaround involves having an external script insert your embedded content. Why? Well, that's legal 'logic' for you. The Javascript solutions I have seen on the net to do this are extremely cumbersome, so I wrote this super lean clean and easy to implement solution.
Credit to Pierz Newton-John.
Code:
function rewriteContent() {
	var v=document.getElementsByTagName("object");
	for(i=0;i<v.length;i++){
		var el=v[i];
		el.outerHTML=el.outerHTML
	}
}

Glen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top