Debugging JavaScript in Internet Explorer

As anyone who has ever received the dreaded Object doesn’t support this property or method error in IE can attest, debugging using everyone favourite browser is a right, royal pain in the heiny. Using Firebug in Firefox really has spoilt us as frontend developers (Hey, what am I talking? These ARE BASIC TOOLS that every other development platform has had since Ada Lovelace was in small britches, but I digress), so what is a cross-platform developer to do?

Little known fact outside of the .NET world: Visual Studio has a complete JavaScript debugger built in, which allows you to set breakpoints, add watches, mess around with variable values and more importantly, gives you better error messages, and actually highlights the line where things went wrong.

  1. Download and Install Visual Studio Express Edition (which is free as in beer).
  2. Create a new Web Site - call it what ever you like, it’s just a placeholder
  3. Hit “Run” (or F5) on the blank problem - a local server should start, and IE7 should load a blank page
  4. Change the URL to the page you want to debug. Once the page is loaded the debugger is good to go - in fact, if your page has any errors, Visual Studio will get focus, and politely tell you as such
  5. To add a break point, flick back to Visual Studio Express and open the JavaScript file you wish to add the break point to, and then refresh the browser - once context hits the point, you will be able to step through the code.

Whilst still lacking a DOM browser (Firebug Lite might be able to help out with that), this takes some of the fun out of debugging JavaScript IE, from the point of view that it is now actually possible.

MythTV + XBMC = HOT SAUCE

In December, I blogged about my new Atom-based MythTV setup. Whilst is was OK, I’ve since bought a Jetway J9F2 coupled with a Core2 T5500 (1.6Ghz) CPU. Let me state this now: it is the best MiniITX based media centre setup there is. It has HDMI and DVI outputs, two gigabit network ports and digital audio, and has enough power to happily decode free-to-air HDTV. The layout suits my case better than both previous boards, as there seems to be more airflow - with two caveats:

  1. You NEED to use low-profile RAM if you want the DVD player to fit. I got some Kingston dual-channel sticks off eBay (2GB worth).
  2. Because I use right-angle PCI riser for my trusty AverMedia DVB-T card, I had to slice some of the plastic off the SATA cable to make it fit (The SATA ports are in a really bad spot). The SATA cable that comes with the board is slightly non-standard, which made it possible to perform the surgery - I don’t think it’ll work on regular SATA plugs, as they are thicker.

But besides that, it really is an awesome rig. Oh, it turns out that the “power” issue I had was actually because the DVD wasn’t sitting properly with the old board, which was causing something to jam, which in turn drew too much power and shut the system down. With the new board (and the low profile RAM) DVD playback works perfectly. I’m yet to try burning.

Anyway, since everything is now working properly, I thought it time to mess around with some more software! It is no secret that the MythTV UI is pretty bad (understatement!) - particulary the video and music plugins. Whilst we use the PVR features A LOT, we also watch videos and listen to music quite a bit, and with the library growing and growing it was getting harder and harder to find what we wanted to watch or listen to.

My little brother introduced me to XBMC a while ago, and I was really impressed. It actually feels like a real media center - it has slick effects, nice themes and just feels better. Up until November last year, it was a Windows only affair, but now the port to Linux has been released, so I have installed it. And it is ace. It’s not perfect, but it sure beats MythTV for video and music watching. Some highlights:

  1. When you are watching a movie, and need to go back to the menu, the video continues playing in a smaller window
  2. You can browse music by Artist, Album and Song (unlike MythMusic which is a horrendous tree setup)
  3. It is smart enough to group TV shows together AND it can pull meta data out not only for TV shows, but episode in those TV shows
  4. You can group different directories, so, if you are like me and have a couple of external drives, you can group movie directories from both drives into one list
  5. I’ve said it before, but (almost counter-intuitively) having nice animations and transistion makes things feel more polished and it does.

Although it does support the MythTV protocol partially for watching live TV, it isn’t ready for prime time yet - you can’t easily change channels, or view the EPG, nor can you change signal inputs or hit record to record a program which means I still need to run MythTV. Mind you, when they implement the API fully, I would happily drop mythfrontend for XBMC.

So make life a little more remote control friendly, I’ve added a custom menu item for XBMC into my /usr/share/mythtv/library.xml that just runs xbmc -fs (full screen mode), so I can select it from the Media menu item in MythTV.

There is still some outstanding issues though:

  1. I need to get my remote mapped properly - for some reason it ignores my arrow keys, which is really annoying. I guess I just need to mess with the Lircmap.xml file to sort that out.
  2. I need to work out how to add an exit menu item on the main menu - I haven’t got a key I can bind to the shutdown menu, which makes to make dropping back to MythTV impossible without a keyboard
  3. There is no interlacing support in the Linux version yet (that I can find anyway) so HD tv is unwatchable - no biggie - I use MythTV for that.

Other than that, give it a go - it is what MythTV SHOULD be. 4 1/2 stars.