/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function async_js(){ scripts = [] scripts[0] = "http://connect.facebook.net/en_US/all.js#xfbml=1"; scripts[1] = "http://platform.twitter.com/widgets.js"; $.each(scripts, function(index){ var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = scripts[index]; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }); }