A
adamF
Hi,
I'm using the following code to edit a style sheet when a page loads
with an onload function. When the code is run locally in Mozilla on a
PC and MAC everything is fine, however when running from a server the
code dose not execute on either platform? Any ideas...
Thanks
function reset() {
if (navigator.userAgent.indexOf("Mozilla") != -1) {
function splitBrowsers() {
if (document.styleSheets[0].cssRules)
return document.styleSheets[0].cssRules;
else
return document.styleSheets[0].rules;
}
function remProp() {
var rule = splitBrowsers();
rule[1].style.removeProperty('background-image');
}
function setPropVal() {
var rule = splitBrowsers();
rule[0].style.setProperty('background-color','white',null);
rule[0].style.setProperty('background-image','url(../i/std/contentTop.gif)',null);
rule[0].style.setProperty('background-position','top
center',null);
rule[0].style.setProperty('background-repeat','no-repeat',null);
rule[2].style.setProperty('margin-top','3px',null);
rule[1].style.setProperty('margin-top','-4px',null);
}
remProp();
setPropVal();
}
else { }
}
I'm using the following code to edit a style sheet when a page loads
with an onload function. When the code is run locally in Mozilla on a
PC and MAC everything is fine, however when running from a server the
code dose not execute on either platform? Any ideas...
Thanks
function reset() {
if (navigator.userAgent.indexOf("Mozilla") != -1) {
function splitBrowsers() {
if (document.styleSheets[0].cssRules)
return document.styleSheets[0].cssRules;
else
return document.styleSheets[0].rules;
}
function remProp() {
var rule = splitBrowsers();
rule[1].style.removeProperty('background-image');
}
function setPropVal() {
var rule = splitBrowsers();
rule[0].style.setProperty('background-color','white',null);
rule[0].style.setProperty('background-image','url(../i/std/contentTop.gif)',null);
rule[0].style.setProperty('background-position','top
center',null);
rule[0].style.setProperty('background-repeat','no-repeat',null);
rule[2].style.setProperty('margin-top','3px',null);
rule[1].style.setProperty('margin-top','-4px',null);
}
remProp();
setPropVal();
}
else { }
}