You don't need jquery. document.write("<script type='text/javascript' src='mylib.js'><\/ script>"); The important part is to escape the / in the </script> tag.
On Jun 6, 3:43 pm, Joshua Daniel Franklin <[EMAIL PROTECTED]> wrote: > Is there a way for jQuery to dynamically load an external js file? > > For example, instead of always including: > <script type="text/javascript" src="lib/type1.js"></script> > <script type="text/javascript" src="lib/type2.js"></script> > <script type="text/javascript" src="lib/type3.js"></script> > > I'd like to load a Javascript file when a user specifies a > function type. Obviously I'd still need to bootstrap jquery.js > in <head>.