Apply browser detection patch which will allow us to determine browser name

with a single line, which is useful for the places in the code where we care
about what browser we're dealing with.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3322 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-06-12 17:42:11 +00:00
parent 6a2637eb20
commit 76f9234e3b
2 changed files with 75 additions and 1 deletions

View File

@@ -9,8 +9,40 @@
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
function init(){
//set title name to include Browser Detection
// this is the only way to test the functionality
// of the getBrowserName() function
//
var header = OpenLayers.Util.getElement("browserHeader");
header.innerHTML = "(browser: ";
var browserCode = OpenLayers.Util.getBrowserName();
switch (browserCode) {
case "opera":
browserName = "Opera";
break;
case "msie":
browserName = "Internet Explorer";
break;
case "safari":
browserName = "Safari";
break;
case "firefox":
browserName = "FireFox";
break;
case "mozilla":
browserName = "Mozilla";
break;
default:
browserName = "detection error"
break;
}
header.innerHTML += browserName + ")";
var map = new OpenLayers.Map('map');
var options = {
@@ -45,7 +77,11 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<table><tr><td>
<h1>OpenLayers Example</h1>
</td><td>
<h3 id="browserHeader"></h3>
</td></tr></table>
<div id="map"></div>
</body>
</html>