corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Script to auto activate flash elemtns in web pages... inside


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Script to auto activate flash elemtns in web pages... inside
Antz
Member

Registered: 28th Jul 03
Location: Leeds         Drives: Myself Insane!
User status: Offline
23rd Jan 07 at 00:34   View User's Profile U2U Member Reply With Quote

Wrap your embedded content in a <noscript> tag with class="ACSel". eg:
<noscript class="ACSel">
<object classid=".....>
....
</object>
</noscript>

Then add this to your <head>:

<script type="text/javascript" src="activecontent.js"> </script>

Add 'onload="rewriteContent();"' to your body tag.

Finally create a file called "activecontent.js" with the below script. Note, you have to put the function in an external script. It cannot be in-line...

code:

function rewriteContent() {
var v=document.getElementsByTagName("noscript");
for(i=0;i<v.length;i++){
if(v.className=="ACSel"){
var el=v;
var nel=document.createElement("span");//create new span element to hold content
nel.innerHTML=el.innerHTML;// fill the newly inserted span with the active content
el.parentNode.replaceChild(nel,el); // and replace the <noscript> element with the <span> element
}
}
}


[Edited on 23-01-2007 by Antz]
Antz
Member

Registered: 28th Jul 03
Location: Leeds         Drives: Myself Insane!
User status: Offline
23rd Jan 07 at 00:36   View User's Profile U2U Member Reply With Quote

Oh.... I tried this on 2 flash elements on one page but it did wierd things...

It seems only to work on one element per page.. wich is ok for now, I guess.
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
23rd Jan 07 at 00:38   View User's Profile U2U Member Reply With Quote

Theres a press release article thingy about it here

http://www.adobe.com/devnet/activecontent/articles/devletter.html
Antz
Member

Registered: 28th Jul 03
Location: Leeds         Drives: Myself Insane!
User status: Offline
23rd Jan 07 at 00:53   View User's Profile U2U Member Reply With Quote

yeah, that's all my code will do... it writes the object from outide the file and iserts it back in
Antz
Member

Registered: 28th Jul 03
Location: Leeds         Drives: Myself Insane!
User status: Offline
23rd Jan 07 at 00:55   View User's Profile U2U Member Reply With Quote

the way that page explains it all is like going via london to get from Leeds to Brdford... mins is simple... but not o efective.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
IT People Mark Petty General Chat 7 548
20th May 03 at 11:09
by Mo
 
Little help needed with ASP script... PaulW General Chat 8 1019
1st May 04 at 10:37
by Ian
 
xhtml validation help Houckham Geek Day 2 374
3rd Jun 06 at 18:37
by Houckham
 
Website Pricing dave17 Geek Day 19 908
16th Dec 06 at 16:13
by MikeLamb
 
Web Design Antz Geek Day 12 946
23rd Jan 07 at 09:04
by AdZ9
 

Corsa Sport » Message Board » Off Day » Geek Day » Script to auto activate flash elemtns in web pages... inside 29 database queries in 0.0119128 seconds