facebook synchronous request using getSession
<p>I have the following code in my head</p>

<pre><code>jQuery(document).ready(function() {
    var pic = 0;
    FB.init({appId: '135570939849404', status: true, cookie: true, xfbml: true});
    session = FB.getSession();
        if (session) {
                pic = "http://graph.facebook.com/" + session.uid + "/picture";  
        } 
});
&lt;/script&gt;
</code></pre>

<p>and the following code in the body:</p>

<pre><code>&lt;script type="text/javascript"&gt;
                                    document.write("&lt;img src=\"" + pic + "\" class=\"avatar\"&gt;");
                            &lt;/script&gt;
</code></pre>

<p>Why is it that in the console it always gives me:</p>

<pre><code>Uncaught ReferenceError: pic is not defined
</code></pre>

<p>I have changed var pic to just pic, to make it global... however, still the problem persists</p>
