Because some components are loaded inside of iframe and need its own jQuery. some compionents are loaded one-by-one and need only one common library
On Mar 23, 9:39 pm, Liam Potter <radioactiv...@gmail.com> wrote: > why would you beloadingthe library for each script? > > Andy789 wrote: > > Hi all, > > > I have different independent modules using jquery and need to avoid > > its doubleloading. So, instead ofloadingjquery, I amloadingthe > > code: > > > if (typeof jQuery != 'undefined') { > > document.write('<script type="text/javascript" src="/templates/ > > yoo_evolution/lib/js/jquery-1.3.2.min.js"></script>'); > > } > > > Also, I have added a line var $j = jQuery.noConflict(); as a last line > > of jquery library file. > > > The problem is that though it writes the code on document write, it > > does not seem that jquery is loaded at all, because I am getting an > > error jQuery not defined. > > > What am i doing wrong here? is there a more elegant way to load a > > library dynamically? > > > Thanks