Why not include jQuery in your <head> and don't worry about it being
already loaded or not in your components. Then remove jquery loading
in all of your components...

This will make sure your components concentrate on their main business logic ...

----
Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com



On Mon, Mar 23, 2009 at 3:55 PM, Andy789 <e...@abcstudio.com.au> wrote:
>
> 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

Reply via email to