We do this because:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
if (jQuery){
alert("success");
}
else{
alert("failure");
}
</script>
document.write to write a script tag with the source URL as a parameter:
<script>
function load_script(src){
document.write(unescape("%3Cscript src='"+src+"' type='text/javascript'%3E%3C/script%3E");
}
</script>
<script>
function load_script(src){
document.write(unescape("%3Cscript src='"+src+"' type='text/javascript'%3E%3C/script%3E");
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
if (!jQuery){
load_script("http://example.com/anywhere/you/want/jquery.min.js");
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
<script>
if (!jQuery.ui){
load_script("http://example.com/anywhere/you/want/jquery-ui.min.js");
}
</script>