You can replace that userID check with $jfbcLibrary->userIsConnected() to simply check if there is a user logged in. We had multiple "getID" type functions previously that were pretty confusing.
Just so you are aware, Facebook recently changed some of their Application Policies. With Open Graph Actions out now, which are meant to post messages on the user's behalf when they interact with your site, you are not supposed to do /feed posts anymore where the message is pre-filled in or where the user isn't aware the post will be made. In the 5.0 release, we still have the ability to post on login and register, but we have a notice at the top mentioning the change and that we no longer recommend using the feature. Additionally, if you want to post to the user's wall, you'll need to add the publish_stream permission to the Additional Permissions field as JFBConnect wont' automatically request that permission anymore.
With all that said, if you want to post using Javascript, you can use an undocumented call in JFBConnect: jfbc.social.feedPost
The definition is:
feedPost:function (title, caption, description, url, picture)
With that, you can create a button or invoke Javascript to show a popup for the user with a pre-filled (editable) message and other information, like:
<a href="#" onclick="jfbc.social.feedPost('Phil's Page', 'Come look at what I found!', 'This great page features dynamically generated images you might like', 'http://yoursite.com', 'http://yoursite.com/link-to-image.jpg');">Click me to share!</a>
Hope that helps get you started and gives you more information. Should you need anything else, let us know.
Alex