Richard
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
> >>> To unsubscribe from this group, send email to
The only way you could reliably control it is for the core system to
be the defacto library loader and each component and module manager to
have have a flag indicating their need to load said library and any
sub-libs, which the core would only then load it if it is not already
being loaded for another module or component already...
There are many "possible" ways of checking for the existence of a
library, such as scanning the DOM, or the raw output HTML stream and
suppressing any duplicate instances of loading the same js lib before
the page is served, but then how do you control the filename, same lib
files might have different names!.....so I can't see how this could be
done reliably, unless you check every module, template and component
and change the code to not load the library(s).
It seems to me there are only possible 2 ways: pass the responsibility
of loading all js lib files to the core - but needs a new core feature
which all TPD's agree to adopt, or to hack the modules, components,
templates to remove any unwanted loads - never a good thing!
Which means there is no true solution and not likely to be!
Also remember that most browsers would cache the js libs anyway and
not reload with every page request so the problem lies in the browsers
DOM rather than a page loading/server overhead.
Mike
>> > >>> joomla-de...@googlegroups.com.
>> > >>> To unsubscribe from this group, send email to
>> > >>> joomla-dev-gene...@googlegroups.com.
>> > >>> For more options, visit this group at
>> > >>>http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>> > >> --
>> > >> Saul Mart�nez
>
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/UUo4geGNFpIJ.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-gene...@googlegroups.com.
if your js code is done well emough, you don't really need to bother about that.
In my js files I always put everything in a single object if I need global vars. Just test the presence of the object at the start of the js file and you can avoid multiple execution. If the requested file is the same, the browser won't ask for it twice if your cache settings ae good enough( should be by default on most servers) and the perfomances on the browser side will be almost the same as if the script is not loaded twice.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/Cs2azHE9CGsJ.
I haven't done it myself, but I think modernizr provides such mechanisms to load js files/libraries when required, which I think will be the best, being that you're working javascript. http://html5boilerplate.com does exactly what Nouak says.
Sent from Samsung Mobile
I liked the earlier suggestion that the js libraries cld work thus out for themselves. In fact i did end up doing that when i first ran into the issue. I'm not sure though how to make that work where a library or plugin is brought in from a cdn.
I've taken a quick look at mernozrs loader but not sure if i understand it.
This must be a common issue for all cms's i would think, but as a previous post pointed out , impossible to address fully without some restrictive registration scheme.