Here's a question, why does IE suck so much?
ugh... embarassingly delivered a web site prototype today which I hadn't re-tested in IE.
I am re-using code that has worked in IE before... but now it's not... it basically hide's and show's DIVS... so the user clicks a button, it will show a given div, then hide the one that contained the button. The code looks like this.
And works great in Firebird, but blanks out the whole screen in IE. IE Also doesn't let me debug my javascript, so I'm lost. Does anyone see anything obvious with the code that would cause it to choke?
-Rob
ugh... embarassingly delivered a web site prototype today which I hadn't re-tested in IE.
I am re-using code that has worked in IE before... but now it's not... it basically hide's and show's DIVS... so the user clicks a button, it will show a given div, then hide the one that contained the button. The code looks like this.
Code:
var browserType;
if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"}
function hide(which_div) {
alert(browserType);
if (browserType == "gecko" )
{
document.poppedLayer = eval('document.getElementById(\'' + which_div + '\')');
}
else if (browserType == "ie")
{
document.poppedLayer = eval('document.all[\'' + which_div + '\']');
}
else
{
document.poppedLayer = eval('document.layers[\'`' + which_div + '\']');
}
document.poppedLayer.style.display = "none";
}
function show(which_div) {
if (browserType == "gecko" )
{
document.poppedLayer = eval('document.getElementById(\'' + which_div + '\')');
}
else if (browserType == "ie")
{
document.poppedLayer = eval('document.all[\'' + which_div + '\']');
}
else
{
document.poppedLayer = eval('document.layers[\'`' + which_div + '\']');
}
document.poppedLayer.style.display = "block";
}
And works great in Firebird, but blanks out the whole screen in IE. IE Also doesn't let me debug my javascript, so I'm lost. Does anyone see anything obvious with the code that would cause it to choke?
-Rob