Page 1 of 1
How to show browser doesn't supported error message ?
Posted: Fri Dec 02, 2011 6:11 am
by premecorp
I have used yahoo ping box, Its working fine on firefox and google crome but it not showing Internet Explorer. So in that case I want to show an error message "IE does not support in yahoo pingbox..." in that place. How can I do this thing if any one have any idea regarding this pls help me...
Regards,
Premashish
Re: How to show browser doesn't supported error message ?
Posted: Fri Dec 02, 2011 11:04 pm
by Eric!
You can detect IE in the html
Code: Select all
<!--[if IE]> <p>Ping Box is not supported by IE</p> <![endif]-->
or you could try in php using:
Code: Select all
$browser = get_browser(null, true);
//uncomment following line to see what's available
//print_r($browser);
if(preg_match("/msie/i",$browser["browser"])) echo "IE sucks";
or find it via javascript with navigator object
Code: Select all
<html>
<body>
<div id="example"></div>
<script type="text/javascript">
txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
document.getElementById("example").innerHTML=txt;
</script>
</body>
</html>