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.

0 Comments

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

extra_context caching data?

August 12, 2008 08:30.38 PM

If you're using Django out there and you happen to use the extra_context variable for your generic templates, you might have noticed that the querysets are being cached and not updated unless you restart your server. The problem is that querysets will be cached by definition of the extra_context dictionary unless they are callable functions. See the example below as it applies to my sidebar.

def get_books():
return Book.objects.filter(status='S').order_by('-post_date')[:3]

def get_albums():
return Album.objects.filter(status='S').order_by('-post_date')[:3]

def get_dvds():
return DVD.objects.filter(status='S').order_by('-post_date')[:3]

def get_blogrolls():
return BlogRoll.objects.order_by('-last_name')

info_dict = {
'queryset': Post.objects.filter(status='P').order_by("-pub_date"),
'date_field': 'pub_date',
'extra_context':{ 'books' : get_books,
'albums' : get_albums,
'dvds' : get_dvds,
'blogrolls' : get_blogrolls,
'form':form,
},
}

1 Comment

JPG > PNG in blogs

August 08, 2008 08:00.57 AM

I made the picture of that homeless guy using Apple's little bulls eye feature because I was lazy when editing the original. Because it made it a PNG, it was way too large. Of course, I didn't notice and the page loaded pretty slowly in Google Reader. I opened up GIMP and made it a lower quality JPG. It looks the same but most importantly, is 1/6 the size.

0 Comments

The Pride of Toronto

August 07, 2008 01:41.00 PM

So I was casually looking out of my hotel room window and from eleven stories high, I noticed quite the site. I wasn't sure if I was having some perception problems or if I was truly seeing what I thought I saw. I observed for a few minutes and came to the conclusion that it was exactly what I thought it was. So, to catch the moment, I tore apart my luggage looking for my camera. When I finally found it, I missed the best moments but I still caught enough evidence for my story.

Please note his pants at his ankles and the cup in his right hand. Yes folks, this guy was dancing in front of Toronto's town hall with his pants at his ankles trying to get money from pedestrians going to work. This was at 7:30AM so he was having quite an early start. Unfortunately, I was late to the first conference session so I didn't have time to run downstairs and get a closer look.

0 Comments

Hippos: Kings of the Jungle

July 26, 2008 02:55.15 PM

Plain and simple, Hippos are the sweetest animals of all time.

  • They have no predator... nobody will mess with these things
  • They're huge. Older males can weigh up to 8,000 lbs.
  • Suprisingly, they can run up to 30 mph on land. Michael Johnson only ran 23.15 mph when he set the 200M world record.
  • They can stay underwater for up to six minutes
  • Hippos are extremely social and gregarious. They stay in groups of huge numbers
  • Just check out the next pic...

Pablo Escobar kept four hippos in captivity at his home in Columbia. After the death, the hippos were too large to move and were left untended. As of 2007, they've multiplied to sixteen hippos and they're terrorizing the house for food. At this rate, Hippos will be taking over South America by 2050 and probably the United States in 2100. Good luck us.

0 Comments

Prototype doesn't evaluate JavaScript very well

July 09, 2008 11:33.58 PM

So here's how I call the Ajax.Updater to bring back some HTML with JavaScript in it.

new Ajax.Updater(myDiv, "/fake/test/",
{
parameters: params,
evalScripts: true,
onComplete: function() { doSomething(); };
}
);

Here's the HTML with JavaScript

<script type="text/javascript">
helloWorld = function() { alert( 'Hello World!'); };
</script>

<a href="#" onclick="helloWorld(); return false;">Click me!</a>

Click Me Doesn't Work!!!!! It throws an error saying helloWorld isn't in the scope as a method.

I'm pretty sure it only works when you have actual JavaScript code that has to be evaluated and not based on events. For instance, rather than having the helloWorld() method call come on the onclick handler, it could be listed as a call in the script tags. My rule... don't put JavaScript in HTML response of an AJAX call.

0 Comments

Kings will not survive without females

July 07, 2008 08:19.55 PM

Please play this song while you read this post...

I'm not talking about Arthur or Henry the VIII. I'm talking about the drinking game that requires a deck of cards, a huge social glass, and a large table. Some of you may call it Circle of Death but in my group of friends, we call it Kings. This is one of those games that a group of guys pregaming for a college party or getting ready to go out on the town just couldn't handle because it's hard to get into with that crowd. It's full of stupid jokes, embarrassing stories, and the best part, laughter. It has a recipe for success and I think I've figured it out.

I was at the beach last week and I realized a few things about people while they're in social situations. Most people will do anything to get a laugh. When it comes to making girls laugh, guys will go to extremes. They will act like farm animals, make sounds they've never imagined, and they'll act ten years younger than their age just to see smiles across the table.

Next time you find yourself in a party with a bunch of people that involves an even amount of gals to guys, look up the rules give it a shot.

3 Comments

The Power of Yahoo Pipes

June 28, 2008 08:20.30 PM

A few years back, Yahoo released Yahoo Pipes as a new tool to create your own RSS feeds. The tool is something I've only used once in the past then let it slip away like many web apps do nowadays. There is a lot of stuff out there to read but it's often hard to find it. Whether you're going to CNN.com, Google News, or you're using your own Feed aggregator, it's always difficult to filter what you really want to read. I either find myself reading through stuff I have no interest in or finding articles on my topic of interest with little supporting content.

On my first experiment last year, I wanted to create a feed for Steelers articles that came from as many news sources as possible. I didn't always want to deal with the annoyance of going through ESPN.com looking for the right articles. I'd rather the articles come to my Google Reader so it takes as little time and effort as possible. The feed I created pulls in feeds from Google News, ESPN, and the Steelers blog site. It checks for duplicates and sorts by any order I want.

It's published here

Here's the picture of how Yahoo Pipes works:

0 Comments

Sex and the City - erggghhh

June 09, 2008 10:00.59 PM

Alright... so I will admit that I saw the Sex and the City movie last week because

  1. It's a guilty pleasure of mine
  2. My odds were incredible... there were 400 women.

I normally don't care to give my opinions on movies because rarely are personal opinions worthwhile since everyone seems to have one when it comes to movies. All the girly stuff, the drama, the cheesy love story aside, there was one huge mistake that made no sense. Jennifer Hudson's character was Louise, the new girl in town playing Carrie's personal assistant while she got her life back on track. Alright, here's the huge problem...

She recently graduated with a degree in Computer Science. C'monnnnn, there's no way in hell, she'd be a personal assistant. I know there's people out there who go to NYC looking for themselves but they portrayed her as this poor kid right out of college with no leg to stand on.

Yes, it's a movie... I know. Being the nerd that I am, I had to document my complaint because I'm pretty sure I was the only person in the theater who even noticed it.

0 Comments

Happy Babuscio

May 03, 2008 03:33.23 PM

0 Comments

Sideways Approach

April 17, 2008 11:56.55 PM

Shout out to my cousin Mark.
Sideways Approach

0 Comments

Bachelor for life

April 17, 2008 11:19.29 PM

So, there are some guys out there(not me) who occasionally want to swing the bat a few more times than others and don't really care about what the ball is really made of, who threw it, or most importantly, where it goes after you hit it. Here's my graph revealing the truth behind the minds of these guys.

0 Comments

Subversion = Sex!

April 07, 2008 05:25.19 PM

I work in a place where they like to lock down EVERYTHING. I can't install subversion nor subclipse so I have a hard time checking out some of my projects that I'm working on outside of work during my lunch hour or breaks. One thing I could do was navigate directly to our subversion host and look at the files there. This was only helpful for reading things but it was better than nothing.

That changed!!!

I apologize for the crappy image. Unfortunately, I had to use MSPaint since we don't exactly have the best software.

0 Comments

A Django site.