Ask your JavaScript questions! Pay money and get answers fast! (more info)

FB.Event to respond after the fb:like post wall dialogue closes JavaScript

Really need some help with this please.

I have this fb:like button...


<fb:like id="fbLikeButton" href="'.$furl.'" show_faces="false" width="450"></fb:like>


And I am redirecting/responding when the like button has been liked. Using FB.Event.subscribe...


FB.init();
jQuery(document).ready(function() {
FB.Event.subscribe("edge.create", function(href) {
var data = { action: "virallocker", myID: "'.$my_id.'"};
jQuery.post("viral-lock.class.php", data, function(response) {
if (virallocker_use) location.reload();
});
});
});



See what happens as standard when you click a 'Like Button' - the post wall dialogue appears...

[[LINK href="http://i.imgur.com/8NJKA.jpg"]]http://i.imgur.com/8NJKA.jpg[[/LINK]]


Now the problem I am having is that the location.reload(); in the javascript, is firing before the 'Post to wall' dialogue has been completed or closed.

location.reload(); runs when the Like button is clicked.

My question is, can someone help me adjust the script so the response runs after the Post to wall dialogue has been closed or posted, instead of the 'Like' button being clicked.

See my problem here on the 'Like' button... [[LINK href="http://goo.gl/9efLZ"]]http://goo.gl/9efLZ[[/LINK]]



Thanks
Josh

Answers (0)

No answers yet.