Archive for August 7th, 2008

“I know kung-fu.”

Internet Explorer is ever the fussy browser.

Sometimes you don’t have control over a whole page but you don’t want to endlessly define repetitive inline styles, so you create a <STYLE> section and away you go! It works just fine in any other modern browser, but IE, at least as of IE7, will refuse to see it.  The solution?  Import the CSS file with JavaScript, and append it to the header yourself.  A bit counterintuitive, but it works.

my-greatest-adventure-66.jpg

The second thing that I needed to do was to show and hide a form element, which is pretty straightforward– just use JavaScript to set the style.display property of the given object, and away you go, right?  Well, sort of.  If I set foo.style.display = “none” in IE, it works as expected and hides the element.  But, the moment that I try to set that style to anything else to show the element again– “table-row”, for instance– the whole thing goes crazy and breaks.  The answer?  $(“foo”).style.display = “”.  The empty string makes it all happy.

Add comment August 7th, 2008


Calendar

August 2008
M T W T F S S
« Jul   Oct »
 123
45678910
11121314151617
18192021222324
25262728293031

Posts by Month

Feeds