August 2008 October 2008

September 2008

IE7 error: "Object does not support this property or method"

September 13, 2008 04:26.40 PM

Cross browser development, hooray... When I'm developing a site, whether big idea or small, I want it to work everywhere. I'm not so much the graceful degradation guy due to laziness and I feel that supporting those stuck in the non-JavaScript ages holds back the advancement of technology. I will usually give minimal features so my sites aren't crippled but there's time when I don't go much out of my way. Anyways, that's a completely different rant. What I'm talking about here is the look and feel of the site in the big browsers, IE, Firefox, Safari, and now Chrome. This includes the JavaScript as well. I'm working on this site that displays a Google Map. The initial XHTML rendered uses a CSS style that hides the DIV in case the user has JavaScript turned off. When the body loads, the element is manipulated through JavaScript to change the display of the element to 'block' so it's no longer hidden. This allows users with scripting turned on to enjoy the map feature. Everything was working well in Firefox(my primary browser) and I switched over to Safari(I own a Mac so I get to test these two first) and everything was working very nicely. I then fired up my Dell laptop to test out IE7 and Chrome.

Chrome...works...very, very, very fast. I'm pretty sure Chrome's V8 JavaScript engine is going to work faster with Google stuff so they can monopolize the mashup market once people start downloading their browser more. Anyways, it worked awesome so I moved on.

IE7...no luck. The map was nowhere to be found. Since I program to IE6(don't ask) at work, I've become accustomed to noticing the little annoying yellow triangle noting a scripting error on the page load. I immediately open it up and got a horrible error message from the folks at Microsoft; "Object does not support this property or method." I did some research and found a few people who had the same issue as me. I checked out my JavaScript code and everything looked fine. The line it was crashing on was here:

        mapWrap = document.getElementById("mapWrap");

Solution: variable names cannot be the same as the DOM element name. I changed the JS variable to mapWrapDiv and it worked...lame Since IE7 treated the DOM element as the variable, my next line of code to change the style caused the exception seen above. Lesson of the day, use the standard of DOM element ID + type of XHTML element name for your JavaScript variables.

1 Comment

Pay attention to details

September 10, 2008 08:55.57 PM

So I'm making a new site that moves between days in a week and the display looks like this:

◄ Wednesday ►

So I at first had it working in Google Chrome, Firefox, and Safari with no problems. For some reason, IE7 would not work! I figured maybe I set my character encoding incorrectly and it wasn't on UTF-8. I checked the encoding of the browser, researched all over the damn place, and found this site, tried all the different encodings but continued to fail.

....annoyed and Mother F'ing Microsoft

I finally paid closer attention to the code and I left out the damn semicolon. I give credit to Microsoft for once. If the encoding is supposed to have a semicolon, please enforce that. What the hell? Just think, all those young up and coming HTML nerds will be hacking away on Firefox or Chrome because they're more popular to that crowd. Meanwhile, more than half their audience will miss out on the little wingding in the corner.

0 Comments

Mad Scientist Ideas?

September 03, 2008 12:11.53 AM

Netflix Prize, Illegal Gambling, or Stock Market?

0 Comments

A Django site.