Hi,
I got very very strange problem. Since 19 of december, when all FireFox in company was upgrated automaticaly, code below stopped working. Strange thing is, when i wanted to solve it, it started to work when i've putted alert() function. Here you have working and not working examples. I'll add that this function is used about 4 times on the site:
NOT WORKING SCRIPT:
function loadJSintoDIV(id, url, switchdiv) {
obj = document.getElementById(id);
if(obj.innerHTML == '' || !switchdiv) {
oelem=document.createElement("script");
oelem.src=url;
oelem.type="text/javascript";
oelem.defer=true;
document.getElementsByTagName("head")[0].appendChild(oelem);
obj.style.height = '';
obj.style.visibility = 'visible';
} else {
obj.innerHTML = '';
obj.style.height = '0px';
obj.style.visibility = 'hidden';
}
}
WORKING SCRIPT:
function loadJSintoDIV(id, url, switchdiv) {
obj = document.getElementById(id);
alert('test');
if(obj.innerHTML == '' || !switchdiv) {
oelem=document.createElement("script");
oelem.src=url;
oelem.type="text/javascript";
oelem.defer=true;
document.getElementsByTagName("head")[0].appendChild(oelem);
obj.style.height = '';
obj.style.visibility = 'visible';
} else {
obj.innerHTML = '';
obj.style.height = '0px';
obj.style.visibility = 'hidden';
}
}
When press "ok" in alert popup, it works, without alert....crap...:?:
Any ideas whats wrong?