Load External JavaScript File
<p>I am trying to load an external javascript file from within javascript but I cannot seem to get it to work. Am I doing something wrong?</p>

<p><a href="http://www.sfu.ca/~jca41/stuph/loadJs.html" rel="nofollow">sample file</a> of my work</p>

<pre><code>function loadJs() {
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js")
document.body.appendChild(fileref); }
</code></pre>
