Where am I going wrong with Javascript SDK Facebook code?

Just trying to post to my facebook wall.

<!doctype html><html>
<script src="http://connect.facebook.net/en_US/all.js"></script>

<script language="javascript" type="text/javascript">

window.fbAsyncInit = function()
        appId  : '279233562265081',
        status : true, // check login status
        cookie : true, // enable cookies to allow the server to access the session
        xfbml  : true , // parse XFBML
        oauth : true // Enable oauth authentication
function post_on_wall()
        if (response.authResponse)
            alert('Logged in!');
            // Post message to your wall
            var opts = {
                message : document.getElementById('fb_message').value,
                name : 'Post Title',
                link : 'www.codefundamentals.com/admin/facebook/index.php',
                description : 'post description',
                picture : 'http://2.gravatar.com/avatar/8a13ef9d2ad87de23c6962b216f8e9f4?s=128&amp;d=mm&amp;r=G'
            FB.api('/me/feed', 'post', opts, function(response)
                if (!response || response.error)
                    alert('Posting error occured');
                    alert('Success - Post ID: ' + response.id);
            alert('Not logged in');
    }, { scope : 'publish_stream' });

<div id="fb_div">
    <h3>Post to your Facebook wall:</h3> <br />
    <textarea id="fb_message" name="fb_message" cols="70" rows="7"></textarea> <br />
    <input type="button" value="Post on Wall" onClick="post_on_wall();" />
<div id="fb-root"></div>
(function() {
    var e = document.createElement('script');
    // replacing with an older version until FB fixes the cancel-login bug
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    //e.src = 'scripts/all.js';
    e.async = true;


That is my full page code. No other files. It tells me I’m logged in but then it says failed to post. Anyone see anything? I haven’t submitted my app for review because it says it will only be listed in app center. Also will my app:

Post to my codefundamentals FB page? Is there a setting for that? It’s a confusing navigation


I’m just really lost with this.

Update-got it all working after hours and hours of work - admittedly more time spent on this than I’d like to admit (I’m only using this to post my article links to FB for me (it will save me 10 seconds) and to tweet for me also. ~20 hours of work to save 30ish seconds.