hello
every page of my site is compliant with strict xhtml standards but for the javascript i use for my footer. when i remove the javascript from the page and link it to a .js document containing the necessary code, no content shows up in IE and firefox. what gives? i have some more javascript linked to a separate file which works fine!
here's the url: http://nostramerica.com/northBeach.html
And here's what i've done to include the javascript file:
[html]
<link href="nostrAmerica.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="drop_down.js" />
<script type="text/javascript" src="footer.js" />
</head>
<body>
and here's a page with the javascript included:
<link href="nostrAmerica.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="drop_down.js"></script>
<script type="text/javascript">
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function setFooter() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var contentHeight = document.getElementById('container').offsetHeight;
var footerElement = document.getElementById('footer');
var footerHeight = footerElement.offsetHeight;
if (windowHeight - (contentHeight + footerHeight) >= 0) {
footerElement.style.position = 'relative';
footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
}
else {
footerElement.style.position = 'static';
}
}
}
}
window.onload = function() {
setFooter();
}
window.onresize = function() {
setFooter();
}
</script>
</head>
<body>
[/html]
thanks for your time!