You're trying to include the file on an unstable DOM. Look at jQuery's "getScript" method. Unfortunately you'd have to have jQuery loaded to use it.
Cheers, -js On 10/29/07, DMS <[EMAIL PROTECTED]> wrote: > > > I'm trying to include jQuery from within another javascript file, > using this.. > > <-- JavaScript Include --> > > function include_js(name) { > > var th = document.getElementsByTagName('head')[0]; > var s = document.createElement('script'); > s.setAttribute('type','text/javascript'); > s.setAttribute('src',name); > th.appendChild(s); > > } > include_js('jquery.js'); > > <-- JavaScript Include --> > > This however, does not work. It does not recognize jQuery... If I use > this same method but include a js file that simply has an alert in > it... that works.... Any ideas how I can include jQuery like this? > Thanks! > >