Wow, I'm trying to do the same and was looking for it at the same time that you posted this question! Not much on this.
I came across a http://www.techjam.gr/2011/web-design/execute-javascript-facebook-button-clicked/ , which explains what to do in order to launch the script callback after the button is pressed very clearly . I see that you are already doing this for the most part, but there may be several parts that you have explained that you left or did not indicate.
I also ran into a lot of problems trying to redirect parent frames, as it causes a javascript access security error for cross-domain. Not sure if this is part of your problem. For my own case, I plan on simply redirecting my iframe page from something like no-fan.php to fan.php on click - I don't need to overestimate whether they are a fan or not with my fangate code if they clicked a similar button.
Hope this helps you.
UPDATE:
Got a job using the links above! Here's what I did (code below): Be sure to use the regular FB.init code. Add a script callback with a redirect code above the button. Add the xfbml version of the similar button. What is it!
Note that I actually used top.window.location and in any case sent it to my fangate evaluation code. The reason is that if you just redirect the frame, it leaves the rest of the page as it is, and it still has a facebook button, similar to the button next to the header. Updating the entire page gets everything you need and avoids confusion.
code:
<div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ appId :'your id here', status : true, </script> <script> FB.Event.subscribe('edge.create', function(href, widget) { top.window.location = 'your tab url'; }); </script> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-like"><fb:like href="your page you want to like" send="false" layout="button_count" width="200" show_faces="false"></fb:like></div>
source share