Hello Google
Today is the day: JotSpot has been acquired by Google, and I’m now a Googler. Wow! This is going to be fun.
Today is the day: JotSpot has been acquired by Google, and I’m now a Googler. Wow! This is going to be fun.
I just realized that I completely neglected to announce that I’m speaking at the upcoming Ajax Experience conference in Boston. I’m going to be talking about WYSIWYG editing on the web: why it’s good in theory and sometimes bad in practice, and how to do it right in your apps. I’ll also get into some of the technical details of writing your own cross-browser editor, and show how you can save a ton of work by using the Dojo editor widget instead of starting from scratch.
Hope to see you there!
Today I was updating some Javascript code to support the rapidly-approaching Internet Explorer 7. There were a few places in the code where there were IE-specific workarounds, which happily are no longer needed in IE 7
thanks to its improved standards support. Yay position:fixed!
Where the code used to check for if (ie) { ... }, now I wanted it to check for if (ie6OrLower) { ... }. So how to you tell the difference between IE 6 and IE 7+? You could parse the user-agent string, but I’d rather detect changes in the javascript object model. Here’s what I came up with:
if (typeof document.body.style.maxHeight != "undefined") {
// IE 7, mozilla, safari, opera 9
} else {
// IE6, older browsers
}
This distinguishes between browsers based on the fact that IE 7 knows about the maxHeight css property, whereas previous versions of IE didn’t. Does that seem like a sane approach to you?
Update: over at Ajaxian Arjan points out that it’s a bit simpler to check for window.XmlHttpRequest, which is also new in IE 7.
This morning I was doing some Safari debugging, and wondered if there was a good javascript shell available for Safari these days. So I searched Google for “javascript shell for safari”. And there on the first page of results I saw this:

Yes, Google knew that out of all the billions of pages on the web, my very own del.icio.us bookmarks are one of the best sources of information on javascript shells for Safari. And it was right - months ago I bookmarked the Mochikit Interpreter, noted that it works great on Safari, and prompty forgot about it. Fortunately Google was there to remind me.