netfront - 9:19 pm on Dec 20, 2010 (gmt 0)
Facebook automatically build the code for you. If you visit the facebook development page [developers.facebook.com...]
For example if you were to add a like button on your website you would visit [developers.facebook.com...] and add your website url and appropriate selections and then just click get code. There will be an option here to retreive the iFrame html.
Hope this helps.