we are talking about joomla's index.php (used as a main page) and
index2.php (used as an iframe). Index2.php is always a part of
index.php. Therefore,

1) if I include jquery to the main page header, the iframe (generated
as index2,php) will not work as there is no jquery in there
2) if I include it to both headers, i will get a double library
3) if I include it only to the iframe part, which is always a part of
the main page, it will work OK, but i will be changing the core
joomla's files and will have to hack it every time when a new version
is out

So, I am trying to load it only, if it has not been loaded before.
Does it make sense now?

On Mar 23, 10:15 pm, Liam Potter <radioactiv...@gmail.com> wrote:
> well, the onesloadingthrough the iframe will need jquery loaded in the
> iframe, and the components loaded one-by-one only need jquery loaded once..
>
> I don't understand what you are trying to do hre, just load jquery in
> the head.
>
> Andy789 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