Showing/hiding a box containing a Facebook profile I see that there are quite some words that are appearing double or more times in my code.

I'm thinking there might be a more efficient way of writing this code, only I don't have the knowledge to do so.

function transitionData(data) {
    if($("div#facebook div#notice").is(":visible")) {
        $("div#facebook div#heading *").fadeOut();
        $("div#facebook div#notice").animate({"opacity":"0"}, function() {
            $("div#facebook div.wrapper &gt; img:first-child").attr("src", "http://graph.facebook.com/"+data.id+"/picture?type=normal");
            $("div#facebook h3").html("Facebook account of &lt;b&gt;"+data.name+"&lt;/b&gt;");
            $("div#facebook div#heading a").attr("href", "http://www.facebook.com/"+data.username);
            $("div#facebook tr:first-child td:first-child b").text(data.id);
            $("div#facebook tr:first-child+tr td:first-child b").text(data.first_name);
            $("div#facebook tr:first-child+tr+tr td:first-child b").text(data.last_name);
            $("div#facebook tr:first-child td:first-child+td b").text(data.gender.charAt(0).toUpperCase() + data.gender.slice(1));
            $("div#facebook tr:first-child+tr td:first-child+td b").text(data.locale);
            $("div#facebook tr:first-child+tr+tr td:first-child+td b").text(data.username);

            $("div#facebook div#notice").slideUp();
            $("div#facebook div.wrapper").slideDown();
            $("div#facebook div#heading *").fadeIn();
        });
    } else {
        $("div#facebook div#heading *, div#facebook div.wrapper").fadeOut(function() {
            $("div#facebook div.wrapper &gt; img:first-child").attr("src", "http://graph.facebook.com/"+data.id+"/picture?type=normal");
            $("div#facebook h3").html("Facebook account of &lt;b&gt;"+data.name+"&lt;/b&gt;");
            $("div#facebook div#heading a").attr("href", "http://www.facebook.com/"+data.username);
            $("div#facebook tr:first-child td:first-child b").text(data.id);
            $("div#facebook tr:first-child+tr td:first-child b").text(data.first_name);
            $("div#facebook tr:first-child+tr+tr td:first-child b").text(data.last_name);
            $("div#facebook tr:first-child td:first-child+td b").text(data.gender.charAt(0).toUpperCase() + data.gender.slice(1));
            $("div#facebook tr:first-child+tr td:first-child+td b").text(data.locale);
            $("div#facebook tr:first-child+tr+tr td:first-child+td b").text(data.username);

            $("div#facebook div#heading *, div#facebook div.wrapper").fadeIn();            
        });
    }
}
From a once over,


You have far more than a few words that are copy pasted, you could extract all the common statements into a common function:

function transitionDataDone( data ){
    $("div#facebook div.wrapper &gt; img:first-child").attr("src", "http://graph.facebook.com/"+data.id+"/picture?type=normal");
    $("div#facebook h3").html("Facebook account of &lt;b&gt;"+data.name+"&lt;/b&gt;");
    $("div#facebook div#heading a").attr("href", "http://www.facebook.com/"+data.username);
    $("div#facebook tr:first-child td:first-child b").text(data.id);
    $("div#facebook tr:first-child+tr td:first-child b").text(data.first_name);
    $("div#facebook tr:first-child+tr+tr td:first-child b").text(data.last_name);
    $("div#facebook tr:first-child td:first-child+td b").text(data.gender.charAt(0).toUpperCase() + data.gender.slice(1));
    $("div#facebook tr:first-child+tr td:first-child+td b").text(data.locale);
    $("div#facebook tr:first-child+tr+tr td:first-child+td b").text(data.username);
}

Once you have done that, you will notice that you are not repeating too many jQuery selectors. The only one that stands out to me is $("div#facebook div#notice"); If you cache this selector and apply the previous code, you get something like this (not tested, but you should get the gist):

function transitionData(data) {
    var $divNotice = $("div#facebook div#notice"); 
    if($divNotice.is(":visible")) {
        $("div#facebook div#heading *").fadeOut();
        $divNotice.animate({"opacity":"0"}, function() {
            transitionDataDone( data )
            $divNotice.slideUp();
            $("div#facebook div.wrapper").slideDown();
            $("div#facebook div#heading *").fadeIn();
        });
    } else {
        $("div#facebook div#heading *, div#facebook div.wrapper").fadeOut(function() {
            transitionDataDone( data );
            $("div#facebook div#heading *, div#facebook div.wrapper").fadeIn();            
        });
    }
}

function transitionDataDone( data ){
    $("div#facebook div.wrapper &gt; img:first-child").attr("src", "http://graph.facebook.com/"+data.id+"/picture?type=normal");
    $("div#facebook h3").html("Facebook account of &lt;b&gt;"+data.name+"&lt;/b&gt;");
    $("div#facebook div#heading a").attr("href", "http://www.facebook.com/"+data.username);
    $("div#facebook tr:first-child td:first-child b").text(data.id);
    $("div#facebook tr:first-child+tr td:first-child b").text(data.first_name);
    $("div#facebook tr:first-child+tr+tr td:first-child b").text(data.last_name);
    $("div#facebook tr:first-child td:first-child+td b").text(data.gender.charAt(0).toUpperCase() + data.gender.slice(1));
    $("div#facebook tr:first-child+tr td:first-child+td b").text(data.locale);
    $("div#facebook tr:first-child+tr+tr td:first-child+td b").text(data.username);
}

Finally, I must say, your approach is terrible. Your elements should have unique id's ( first_name, username etc. etc. ), the way you select elements now is a maintenance nightmare. Re-ordering the elements means re-writing the JavaScript code!