Monday 29 March 2010

IE6ing still

When I had breakfast this morning there was a sparrow-hawk just sitting on next-doors fence. It wasn't doing anything, just sitting there in the rain.

I spent most of the morning writing up yesterday's blog post.

I looked into the problem with IE6 that I was working on yesterday a bit more, as it was still giving javascript errors about expecting an object when viewing the large versions of PNGs. Using Microsoft Expression Web, it was giving me an error at a different point to where it was with the JPEG problem I was having in IE6 yesterday. But the error was still about an object being expected, even though all variables at the point the error was indicated to occur were correct.



After lunch I decided to try debugging this error with the placement of alert()s, and found that the problem seemed to be caused by setting the display of a div to block. Despite trying changing many different things, and even wrapping the contents of each function in a try-catch block, I still got the same error about an object being expected.

Next I did a save page in IE6, then gradually stripped the HTML and Javascript down to the very basics, making sure to test page and check I was still getting the error each time I removed something. Eventually I discovered that actually the error was not in the javascript (file) at all, but in the CSS (file). In the CSS I had a CSS expression, which is Microsoft proprietary, and lets you use javascript expressions for calculating widths, heights, etc. Due to the way window.onresize works in IE6, sometimes you have no choice but to use a CSS expression, which is what I'd done here. But in the expression, I'd missed out the quote marks around an element's id e.g. document.getElementById(lbImg), when it should be document.getElementById('lbImg').

So the error about an object being expected was (kind of) correct - document.getElementById() should expect a string, not an object, but IE would expect lbImg to be an object/variable, when actually it was just null. It's annoying that MS Expression Web would say the error was occurring in the js (file) though, when actually it was occurring in the CSS (file).

Before dinner I watched some late 1800's short films with Mauser and L.

In the evening I watched an episode of Star Trek with Mauser and L, then did some work on a couple of panos (one only a partial pano).

The weather was rainy all morning. In the afternoon it was overcast but bright, then later in the afternoon and evening it rained again.

Food
Breakfast: Bowl of Choco Moons Cereal; Cup o' Tea.
Lunch: Mustard Ham Sandwich with Dijon Mustard; Packet of Smokey Bacon Flavour Crisps; Banana; Slice of Sponge Cake with Forest Fruits Jam, Butter-cream, and Icing; Cup o' Tea.
Dinner: Beef Burger with Fried Sliced Gherkin, Tomato Ketchup, and Grated Mature Cheddar Cheese in Bun; Baked Beans; Deep Fried Potato. Pudding was 2x Fairtrade Chocolate Cookies. Coffee; Dubble Chocolate Bar.

No comments: