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. ...
Get Facebook Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.