Tag Archives: javascript

How to shrink your Facebook tabs iFrame when AutoGrow fails you.

Facebook AutoGrowWhen building a Facebook application tab, Facebook gives you a great function called FB.Canvas.setAutoGrow (formally FB.Canvas.setAutoResize) that allows for the Facebook iFrame to automatically figure out how tall it should be to incorporate all your content. As you switch between pages in your app, it continues to grow as needed.

The downside is that it doesn’t shrink. If your first page is 2000 pixels tall, and your second is only 800, the iFrame remains at 2000 pixels and you get a bunch of empty white space at the bottom.

This isn’t a bug, it’s a feature. FB.Canvas.setAutoGrow grows. And when you grow, you don’t get smaller; ever.

Teaching Myself jQuery – Here’s What I’ve Learned So Far

jQueryI finally did it. I’ve been wanting to learn jQuery for a while, but haven’t had the chance to sit down and do it. So I took some time over the past week and jumped in.

Turns out, it’s just as cool as everyone says.

Here are a few things I’ve learned so far:

It’s Simple

You don’t have to know anything to add jQuery to your site. Just add a line of code to your files and you’ve got the base for all jQuery scripts. No configuration necessary. Heck, you don’t even need to host it! Let Google do that for you.

Fastest Mac Browser Test: Firefox 2, 3 and Safari

Have you checked out Dromaeo.com?  It’s a Mozilla owned site that runs a set of JavaScripts and test out how fast your browser is.  I tried it on my iMac, 1.83 Intel Core Duo with 1.5 GB 667 MHz DDR2 SDRAM, and found Firefox 3 beta 5 to be the fastest browser.  Oddly enough, Firefox 2 was the slowest, even behind SeaMonkey!

Granted, this is no professional test.  Firefox 2 has the  most extensions on my computer and that could cause slowness.  There are always a lot of factors to take into consideration, but this is what my tests show.