Detect if user has vitalize installed (javascript)
Here is a small javascript I hacked together to test if an user has vitalize installed, might be a smarter way to do it but I don't know... :)
Anyways the code:
Code:
<SCRIPT LANGUAGE="Javascript">
<!--
if(navigator.plugins.length >0 && navigator.plugins["Vitalize!"]){
document.write("User has vitalize <br />" );
}
else {
var ie=new ActiveXObject("ATXVitalize.Vitalize.1");
if(ie){
document.write("User has vitalize <br />" );
}
}
// -->
</SCRIPT>
Happy homepage cooking!
Re: Detect if user has vitalize installed (javascript)
Re: Detect if user has vitalize installed (javascr
Nice. To make your code HTML 4.01 (Strict & Transitional) compliant a developer would need to add type="text/javascript" to the script tag (and presumably use <br> instead of <br />).
An XHTML 1.0 (Strict & Traditional) and 1.1 compliant version would look something like:
Code:
<script type="text/javascript">
//<![CDATA[
if(navigator.plugins.length >0 && navigator.plugins["Vitalize!"]){
document.write("User has vitalize <br />" );
}
else {
var ie=new ActiveXObject("ATXVitalize.Vitalize.1");
if(ie){
document.write("User has vitalize <br />" );
}
}
//]]>
</script>
Re: Detect if user has vitalize installed (javascr
Umm I don't use HTML and stuff like that, so I don't really understand this... Is there a way to make the website display certain text if they do/don't have Vitalize! ?
Re: Detect if user has vitalize installed (javascr
Quote:
<script type="text/javascript">
//<![CDATA[
if(navigator.plugins.length >0 && navigator.plugins["Vitalize!"]){
document.write("You have vitalize");
}
else {
var ie=new ActiveXObject("ATXVitalize.Vitalize.1");
if(ie){
document.write("You have vitalize" );
} else {
document.write("You do not have vitalize");
}
}
//]]>
</script>
Replace the "User has vitalize" and "User does not have vitalize" with whatever you want.
Re: Detect if user has vitalize installed (javascr
Code:
<script type="text/javascript">
//<![CDATA[
if(navigator.plugins.length >0 && navigator.plugins["Vitalize!"]){
document.write("You have vitalize");
}
else if(navigator.plugins.length ==0) {
var ie=new ActiveXObject("ATXVitalize.Vitalize.1");
if(ie){
document.write("You have vitalize" );
}
}
else {
document.write("You do not have vitalize");
}
//]]>
</script>
Updated it a bit, fixes an problem ;)
Re: Detect if user has vitalize installed (javascr
Great, this is a very useful code. :)
Re: Detect if user has vitalize installed (javascr
This code doesn't work under IE6 & 7 but on FireFox ...
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Webpage</title>
</head>
<body>
<script type="text/javascript">
//<![CDATA[
if(navigator.plugins.length >0 && navigator.plugins["Vitalize!"]){
document.write("You have vitalize");
}
else if(navigator.plugins.length ==0) {
var ie=new ActiveXObject("ATXVitalize.Vitalize.1");
if(ie){
document.write("You have vitalize" );
}
}
else {
document.write("You do not have vitalize");
}
//]]>
</script>
</body>
</html>
Re: Detect if user has vitalize installed (javascr
I havn't tested it with out vitalize so I am unsure, but it does work as far as i say that I do have it on ie6-8.. I will take a test run with out having vitalize installed when I get the time...
Re: Detect if user has vitalize installed (javascr
in fact, in IE6 & IE7, I have no text!