Tema: Paslepti swf, jei nera instaliuotas flash?
Autorius: System
Data: 2010-08-07 13:33:03
Sveiki,

Noriu, kad atejus I svetaine ir neradus Flash player'io, su JS pagalba butu 
pasleptas SWF. Nereikia man, kad siulytu parsisiusti nauja player'I ar dar 
kazka, reikia tiesiog, kad pasleptu SWF.

Susiradau scripta, kuris aptinka ar yra reikiama player'io versija:

<script src="Scripts/AC_OETags.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// -->
</script>

Tada radau funkcija per google, kuri paslepia contenta, pagal tam tikra ID:

<script language="JavaScript" type="text/javascript">
 function swapVisibility(elmID)
 {
   if (document.getElementById(elmID).style.display != "none")
   {
      document.getElementById(elmID).style.display="none";
   } else {
     document.getElementById(elmID).style.display="block"; // or static, or 
fixed, or inline, whatever you like.

  } // end if;
</script>

Galiausiai ikisau I puslapio gala, pries </body> tag'a, toki skripta:

<script language="JavaScript" type="text/javascript">
<!--
// Version check based upon the values entered above in "Globals"
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, 
requiredMinorVersion, requiredRevision);

// Check to see if the version meets the requirements for playback
if (hasReqestedVersion) {
	// if we've detected an acceptable version
	// embed the Flash Content SWF when all tests are passed
	swapVisibility(logoID)
}
</script>

Turiu DIV'a, kurio ID=logoID, taciau nesuprantu kodel kodas neveikia. Gal 
kas numanot ka blogai darau? Arba gal yra koks zymiai paprastesnis budas 
igyvendinti tai ka noriu?