O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Use Firebug (No, Seriously)

Problem

Unfortunately, I lack any form of extrasensory powers and have no idea why my HTML isn’t rendering properly, what my Ajax calls are returning, or the first clue why my JavaScript is behaving like it’s possessed.

Solution

Install Firebug, a Firefox add-on, and make your life considerably easier. Install it with a single click from http://www.getfirebug.com/, give your browser a quick restart, and then click on the little bug icon in the status bar at the bottom of your window and let the festivities begin.

If you’re not running Firefox, you can still access some of this functionality by including the firebug.js JavaScript file in your pages (although this may fail when parsed through the FBJS parser). For more information, see http://www.getfirebug.com/lite.html. Do yourself a favor, though, and download Firefox and Firebug just to see how much easier this will make your life. You should still test in Internet Explorer and Safari, but your joy in building Facebook applications (and any other web project) will increase by the bucketload.

Discussion

Some web developers are born with a sixth sense that lets them do freaky things like writing flawless cross-browser HTML on the first try or crafting brilliant JavaScripts that make my head hurt to even contemplate. For the rest of us, there’s Firebug. If you’re a devout Internet Explorer or Safari user, you’re going to want to just skip to the next recipe before you find your life changing in unexpected ways. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required