Refreshing Social Media Widgets in AJAX Content

Many social media widgets are parsed upon page load, and thus adding new content via AJAX will not trigger the widgets to rebuild themselves.

Each widget has a different solution to force re-rendering.

I needed them for Twitter, Facebook, and GPlus. Add the following to your AJAX content (or fire it off yourself when you’ve done the AJAX call).


$.ajax({ url: '', dataType: 'script', cache:true});


try { 
} catch(ex) {};

Google Plus

try { 
} catch(ex) {};

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s