Checking the flash version does not works for Mac.
I want to check for a proper flash version installed, if the user does not has it, prompt him/her to do so. My code works fine in Windows platform, but not on mac.
Please can you explain me what should I do to fix the issue.
My code for html is given below:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Cloud.cm - Connect.Collaborate.Share</title>
<meta name="alexaVerifyID" content="1ZfWQK0CZlGJ0cqpEL7Otjh83hU">
<meta name="description" content="Collaboration tools for individuals and global companies alike. Cloud simplifies online file storage, replaces FTP and connects teams in online workspaces.
Cloud brings online collaboration to your documents, music, video, calendar, email and chat in a lightweight easy to use readily available solution.">
<meta name="keywords" content="free online storage, online storage, file sharing, online file storage, share files online, store documents online, online collaboration, collaboration tools, ftp replacement, sharepoint alternative, file storage, mobile data access, share files online, asset management, online workspace, workspace, project management software, online collaboration, document sharing, document management, document editing, music sharing, video sharing, video chat, chat, email, calendar, calendar sharing">
<!-- external style sheet -->
<link href="assets/index_main/css/cloudstyle.css" rel="stylesheet" type="text/css">
<link href="assets/index_main/css/cloudsplash.css" rel="stylesheet" type="text/css">
<!-- non-HTML5 browsers -->
<script>
document.createElement('header');
document.createElement('footer');
document.createElement('section');
document.createElement('aside');
document.createElement('nav');
document.createElement('article');
</script>
<!-- swfobject -->
<script type="text/javascript" src="lib/swfobject/swfobject.js"></script>
<!-- jquery -->
<script type="text/javascript" src="lib/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript">
// we will add our javascript code here
$(document).ready(function(){
var lopen = false;
$('#login').hide();
$("#b_login").click(function(){
if (!lopen) {
$('#login').show();
lopen = true;
} else {
$('#login').hide();
lopen = false;
}
});
$("#login header img#b_close").click(function(){
if (lopen) {
$('#login').hide();
lopen = false;
}
});
});
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<body onLoad="MM_preloadImages('assets/index_main/images/rol_login.jpg','assets/index_main/images/rol_signup.jpg', 'login.swf','assets/index_main/images/rol_close.jpg')">
<!-- HEADER -->
<header>
<nav>
<ul>
<li><img src="assets/index_main/images/btn_login.jpg" alt="Log In" name="b_login" width="204" height="50" id="b_login" onMouseOver="MM_swapImage('b_login','','assets/index_main/images/rol_login.jpg',1)" onMouseOut="MM_swapImgRestore()" style="cursor: pointer;"></li>
<li><a href="signup.html"><img src="assets/index_main/images/btn_signup.jpg" alt="Sign Up" name="b_signup" width="154" height="50" id="b_signup" onMouseOver="MM_swapImage('b_signup','','assets/index_main/images/rol_signup.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></li>
</ul>
</nav>
</header>
<!-- SECTION -->
<section>
<!-- LOG IN -->
<div id="login">
<header>
<img src="assets/index_main/images/hd_login.jpg" alt="Cloud LOG IN" width="98" height="42" align="left">
<img src="assets/index_main/images/btn_close.jpg" alt="Close" name="b_close" width="42" height="42" align="right" id="b_close" onMouseOver="MM_swapImage('b_close','','assets/index_main/images/rol_close.jpg',1)" onMouseOut="MM_swapImgRestore()" style="cursor: pointer;"></header>
<div id="flashlogindiv">
<!-- FLASH Log in Movie -->
<object id="flashlogin" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="420" height="180">
<param name="movie" value="login.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="login.swf" width="420" height="180">
<!--<![endif]-->
<!--[if gte IE 6]>-->
<p>
Either scripts and active content are not permitted to run or Adobe Flash Player version
10.2.0 or greater is not installed.
</p>
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
</a>
<!--[if !IE]>-->
开发者_StackOverflow </object>
<!--<![endif]-->
</object>
</div>
</div>
<img src="assets/index_main/images/logo_cloud_vertical.gif" width="315" height="310" alt="Cloud.CM">
</section>
</body>
</html>
Thanks in advance Zee
I recommend SWFObject, it is standards compliant and very powerfull.
The way I've coded to check if flash exists (or if a particular version is present) is: (and works in IE 7, 8 and Safari + firefox + opera on the mac, which is particular to your question).
var hasFlash = false;
//testing for version 1, change here!
if (swfobject.hasFlashPlayerVersion("1")) {
hasFlash = true;
}
//not present or different version
if (!hasFlash) doSomething;
精彩评论