I had an issue where I was building fade transitions between pages for a client, so I needed to update the title. I was using jQuery for a bunch of things so naturally I would do something like:

$("title").text("Wooo. New title!");

This works great in Chrome, Firefox and IE9, but not in IE7 or 8. Thankfully IE9 has a debugger so it was easy switch the browser into compatibility mode and trace the exception.

Turns out in older versions of IE the title element is magical and wasn’t letting jQuery appendChild (I’m also a bit surprised they aren’t checking this condition.) Instead old DOM0 comes to the rescue, which lets you set a title like so:

document.title = "Woo. New title!";
  1. scribblepadofdoom posted this