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="nostrAmer ica.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="nostrAmer ica.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.innerHei ght;
}
else {
if (document.docum entElement && document.docume ntElement.clien tHeight) {
windowHeight = document.docume ntElement.clien tHeight;
}
else {
if (document.body && document.body.c lientHeight) {
windowHeight = document.body.c lientHeight;
}
}
}
return windowHeight;
}
function setFooter() {
if (document.getEl ementById) {
var windowHeight = getWindowHeight ();
if (windowHeight > 0) {
var contentHeight = document.getEle mentById('conta iner').offsetHe ight;
var footerElement = document.getEle mentById('foote r');
var footerHeight = footerElement.o ffsetHeight;
if (windowHeight - (contentHeight + footerHeight) >= 0) {
footerElement.s tyle.position = 'relative';
footerElement.s tyle.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
}
else {
footerElement.s tyle.position = 'static';
}
}
}
}
window.onload = function() {
setFooter();
}
window.onresize = function() {
setFooter();
}
</script>
</head>
<body>
[/html]
thanks for your time!
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="nostrAmer ica.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="nostrAmer ica.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.innerHei ght;
}
else {
if (document.docum entElement && document.docume ntElement.clien tHeight) {
windowHeight = document.docume ntElement.clien tHeight;
}
else {
if (document.body && document.body.c lientHeight) {
windowHeight = document.body.c lientHeight;
}
}
}
return windowHeight;
}
function setFooter() {
if (document.getEl ementById) {
var windowHeight = getWindowHeight ();
if (windowHeight > 0) {
var contentHeight = document.getEle mentById('conta iner').offsetHe ight;
var footerElement = document.getEle mentById('foote r');
var footerHeight = footerElement.o ffsetHeight;
if (windowHeight - (contentHeight + footerHeight) >= 0) {
footerElement.s tyle.position = 'relative';
footerElement.s tyle.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
}
else {
footerElement.s tyle.position = 'static';
}
}
}
}
window.onload = function() {
setFooter();
}
window.onresize = function() {
setFooter();
}
</script>
</head>
<body>
[/html]
thanks for your time!
Comment