Reload facebook like button after ajax call
Tue 17th May 2011
This is how to force the a facebook like button refreshes after an ajax call.
I had an issue. When calling an ajax function within a lightbox, if there was a facebook like button being called then it would not render the like button. The facebook like button needs to be rerendered or reloaded using jquery/javascript.
I took this xfbml like code:
and added a class to it like so:
Notice that I also wrapped the button within another div of class facebook. I then created a function to reload the facebook like button:
This reloadSocial function needs to be called after the ajax load. For example, I wanted it to load once the facebox ajax call had completed using this:




