Return to Snippet

Revision: 48916
at July 12, 2011 23:33 by dan_hoerr


Initial Code
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);
	});
	
}

Initial URL

                                

Initial Description

                                

Initial Title
Async load any number of remote JS resources

Initial Tags
javascript

Initial Language
JavaScript