Tuesday, 14 September 2010

Google Mapping

Today I was mainly just doing more work on my google maps implementation for my photo website. After spending the last few days trying to get it to work with info bubbles that use iframes, I eventually gave up on that idea.

The problem was IE6, which throws an error about iframe.contentWindow being undefined. The problem with this is, that it throws that error when you're trying to check if the contentWindow property exists.

So
  • if(iframe && iframe.contentWindow)
  • if(iframe && typeof(iframe.contentWindow) != 'undefined')
both give the same error about contentWindow being undefined. The annoying thing is, when using MS Visual Web Developer Express to debug the error, it will break at the error, and if you check the value of iframe.contentWindow, it shows it as being a real property (with many sub properties of its own), and certainly not 'undefined').

Since the problem was impossible to debug or fix, I decided instead to just use AJAX to retrieve the page I was previously loading in the iframe. Using jquery this is relatively easy, and certainly much quicker to implement than all the tens of hours I spent on the iframe method.

No comments: