I’ve created a Facebook fan page that works as a fan gate / like gate. When the user clicks the “Like” button the page redirects to the wall. I want to override this behavior and have the page redirect back to the Liked version of the fan gate. The app is an iFrame page tab app using the PHP signed request to determine liked/notliked status.
An example of this is http://www.facebook.com/1800flowers
When you like the page, it redirects you to http://www.facebook.com/1800flowers?sk=app_116748578401618
So my search-fu found a piece of JavaScript that was supposed to fix this:
<script type="text/javascript">
if (top != self) top.window.location = 'linkgoeshere';
</script>
I’ve tried placing this block of JavaScript in both the have liked and have not liked sections of the page. Either way it creates a redirect loop where the page just continually refreshes.
If this code is the answer, where should it be located, and what should “linkgoeshere” be replaced with? There is a possibility I’ve been using the wrong link.
If this isn’t the answer, is there an alternative?
I’ve been having this problem for the past few days, but today I found the solution. You were right with your suspicions that this is caused by the new recommend dialog box on pages. This box only appears on pages for PLACES. If you have a address assigned to your page then remove it and your fangate will reload in the window when liked and not redirect to the wallpage.