This is an example worked through by others on #dojo IRC channel on Freenode. It pushes a script tag to load dojo.js, and hooks onto the relevant load event to callback when the load is complete and it’s safe to invoke the symbols defined in the script.
functionloadScript(url,callback){varscript=document.createElement("script")script.type="text/javascript";if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;callback();}};}else{script.onload=function(){callback();};}script.src=url;document.getElementsByTagName("head")[0].appendChild(script);}window.onload=function(){loadScript("https://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js",function(){console.log("dojo.js has now loaded. require, define etc. global symbols are now exported and ready for use. ");require(["dojo/dom","dojo/fx","dojo/domReady!"],function(dom,fx){console.log("** use dojo here! **");});});}