var load_script = function(url, onload){
var script = document.createElement("script");
script.src = url;
if(typeof onload === "function"){
script.onload = onload;
script.onreadystatechange = function(){
if(readyState=="loaded" || readyState=="complete"){
onload();
}
};
}
document.body.appendChild(script);
};

load_script("//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js",function(){
alert("script load success!!");
});