Facebook and twitter buttons for ajax content

July 15, 2014   |   1 minute read.

When I load content with ajax I lost, of course, some functions like the “facebook like button” or the “tweet this”. But there’s an easy way to add bind this functions again.

For example, I am adding the following template with mustache:



So then in the javascript file that you build html or render the mustche we can simply add this:

// Facebook button

// Twitter button

Further reading for facebook and twitter.