Archive for November, 2006

When all else fails, wrestle in Jello

November 30th, 2006

My current role at Google requires me to go through and look at a lot of various AdWords advertisements throughout the day. Some of which are standard goods and services, others are porn, and some are crazy home-based marketing programs. Every once in a while, though, you come across a gem like Fun Jell, the official Jello made for Jello Wrestling.

It’s hard to hold back sharing something like this, considering the fantastic video they have on their homepage. So, the next time you need to host an event — why not break out the kiddie pool and fill it with Fun Jell. It could be considered the World’s Best Icebreaker.

“Come on guys, who’s up next for Jello Wrestling?”

 

In the spirit of the Holidays

November 29th, 2006

From an Internal office email:

Today Bristol – Myers is donating a dollar to AIDS everytime someone goes to their website and moves the match to the candle and lights it.

Please forward this link on: https://www.lighttounite.org

Remember, December 1st is World AIDS day.

A mash-up of a major f-up

November 29th, 2006

We’re all well aware of Michael Richard’s comments that were made last week, but someone had enough time to piece together this great “Lost Episode” of Seinfeld with old episode footage and footage from his outburst. It’s highly entertaining for all Seinfeld fans.

The Shopping Season

November 27th, 2006

The shopping season has begun. Black Friday was just a few days ago, and today we’re in the midst of what is known as . Though I dislike the term, nobody really asked me.

One item I wanted to point out is that any site using Google Checkout is offering a $10 discount on all your holiday purchases. I’ve known about this for quite some time, but I didn’t quite realize the extent of sites that are using the GoogleCheckout product. The include , , , and many many more.

Learn more about the Google Checkout program and the participating stores. I can’t think of any reason not to get started today!

The first Thanksgiving

November 25th, 2006


Our First Thanksgiving
Originally uploaded by brandonjs.

After our recent relocation to the West Coast, MP and I had decided not to take the trip back East for the Thanksgiving holiday. As a result, we opted to have our own Thanksgiving (just the two of us) here in Santa Clara. Last Sunday we did all our shopping and the menu looked something like this:

Turkey, of course
Darlene’s Crockpot Stuffing®
Apple-Cranberry Chutney
Sweet Potato Mash
Two-Potato Mash
Green Beans
and MP’s favorite — Hot Rolls.
Apple Pie w/ Vanilla Ice Cream
Pumpkin Pie with Vanilla Ice Cream

With the exception of a minor snafu with the Turkey (not knowing how long to cook it for, and without a meat thermometer things got a little dicey), everything went according to plan. After all was said and done, the dinner table was set and everything was delicious. Looking at the picture, it’s hard to imagine that all this food was for just two people — but it was. And boy do we have leftovers.

I guess that’s what Thanksgiving is for, though, right? More Thanksgiving photos

Detecting Pop-up Blockers with JavaScript

November 23rd, 2006

I recently needed to tackle the problem of detecting pop-up blockers for my job. While I found some useful information through Google search, many of the code examples did not work in all scenarios and were focused on opening an arbitrary window just to close it to then see if the pop up window was blocked. In real world scenarios, you often want to detect that a newly opened window was blocked — without closing it — so that you can then take some useful action on the blocked event, like say using location.href to redirect to the appropriate URL.

I thought it would be useful to others to post my version of pop up blocking here. I have tested this code on Firefox and Internet Explorer 6 on Windows. It works in IE with Yahoo!, Google, MSN, or AOL toolbar’s pop-up blockers.

<script type="text/javascript">
function checkOpenWindow (openWin, keepFocus)
{
    var exists = false;
    if (openWin && !openWin.closed)
    {
        exists = true;
        try {
            openWin.focus();
        }
        catch (e) {
            keepFocus = false;
            exists = false;
        }
        if (!keepfocus)
        {
            window.focus();
        }
    }
    if (!exists)
    {
        alert("The window you attempted to open was blocked");
        // do something here
    }
    else
    {
        alert("Your window successfully opened");
        // generally do nothing
    }
}

var popupWin = window.open('http://www.thediatribe.net/', 'popupName', 'width=500,height=500,toolbars=no');
checkOpenWindow(popupWin);
</script>

An explanation:

  • The popupWin variable provides a reference to the window opened through window.open. Storing the return value of window.open is the only method JavaScript provides for accessing the opened window. The return value of window.open may be null.
  • The checkOpenWindow function contains the logic to determine if the popup window was successfully opened. I have included a keepFocus parameter here (described further down). You could easily extend the function to provide callbacks for handling when the window exists or does not exist.
  • The most basic check is to determine if the openWin parameter is not empty.
  • The window object has a closed property that will return true if the window has been closed.
  • Some popup blockers, especially the toolbar ones, close the window in such a way that the window’s closed property returns false even though the window has been blocked. As a final check, we try to call the focus method on the openWin. If that fails, then the window was blocked.

    window.focus() is called to revert the focus to the parent window. If the keepFocus parameter is set to true, the focus will not be reverted. However, if the opened window does not exist the focus is always reverted.
  • I have seen many code samples online that use a setTimeout to determine if the window has been blocked for Yahoo! toolbar. In that approach, you do not need to focus the opened window, however, I have found that the only way to properly detect popup blocking from the AOL toolbar is to attempt to focus the opened window.

One neat little app

November 21st, 2006

Sometime over this past weekend, I stumbled upon a pretty cool little application that allows you to write blog posts offline. I’ve found a number of these products ands services over the years, but Ecto best – hands down.

The application is fully-customizable, allowing you to update any number of blogging systems including Wordpress, Movable Type, Blogger, etc. But it includes everything from built-in Amazon referral link templates to Flickr and image options. It allows to you to create posts using a Microsoft Word-like interface, save them for later, spell check, and several other great features.

When I first read about this application, the reviewer said something like “I couldn’t imagine writing a blog post without Ecto anymore..” And to be honest, I have to say that I’d probably agree. The software is available for both Windows or Mac, so there’s no excuse not to get started!