Return to Snippet

Revision: 37148
at December 4, 2010 21:27 by fulvius


Initial Code
function loadJquery(onLoadListener){
	loadJquery.loaded = false;
	var fileref = loadJSfile("https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
	fileref.hasStarteHelper = false; // usando variavel estatica
	if(! loadJquery.loaded){
		fileref.onreadystatechange= function () {
				
				if(!this.hasStarteHelper){
					if (this.readyState == 'complete' || this.readyState == 'loaded'){
						onLoadListener();
						loadJquery.loaded = true;
					}
				}	      
		};
		
		fileref.onload= function () {
			if(!this.hasStarteHelper){
				onLoadListener();
				loadJquery.loaded = true;
			}
		};
	
	}else{
		onLoadListener();
	}
}



function prepareToDisplay(){
// alert('adObj');
	var executeWhenJqueryLoad = function(){
// alert('JqueryCarregado!');
		$(document).ready(function(){
 alert('JqueryCarregado!');
//			displayAdInClassEl(null);
			});
	};

	loadJquery(executeWhenJqueryLoad);
}

Initial URL


Initial Description


Initial Title
prepare loadJquery

Initial Tags


Initial Language
JavaScript