The following HTML/javascript document illustrates a question I have with client-side Macintosh users. The <div ID="NavBarDiv"> does not load using any of my IE or NN-compatible commands.
Does Macintosh support an equivalent command?
How do I detect Macintosh users?
On a Macintosh computer, notice that the website
www.finehomemadesoap.com does not have a navigation bar, because I generate HTML for the navigation bar, and then load it into the <div> block using the script shown below.
Thanks, Daniel
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<div ID="NavBarDiv" style="position: relative; left: 10px; top: 0 px;">
Loading...<br><br>Appologies Macintosh users.<br>If wait is longer than 1 second, loading is unsuccessful.
</div>
<script language="JavaScript" type="text/javascript">
//document.getElementById('NavBarDiv').innerHTML = "Hello hello hello.";
var navBarHTML = 'Hello.<br>You have successfully written HTML.' ;
var documentContainingTag = window.document;
//writeInnerHTML(documentContainingTag,'NavBarDiv',n avBarHTML)
function writeInnerHTML(documentContainingTag, tagID, HTML) {
var htmlElement;
if (document.layers) { // NN4. Layers are supported.
htmlElement = documentContainingTag.layers[tagID].document;
htmlElement.open();
htmlElement.write(HTML);
htmlElement.close();
} else if (document.all) { // IE4+.
htmlElement = documentContainingTag.all[tagID];
htmlElement.innerHTML = HTML;
} else if (document.documentElement) { // NN6.
htmlElement = documentContainingTag.getElementById(tagID);
htmlElement.innerHTML = HTML;
}
}
</script>
</body>
</html>
Daniel Hutchins
Woodbridge, CA
http://www.finehomemadesoap.com