jquery librairies

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Fri Jan 04, 2013 7:34 pm
Reply with quote
Report this post
Hello,

Just a quick question, I'm using Publisher and the site loads the script from /media/ folder:

<script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>

Since the libraires are being updated frequently I was wondering if we souldn't change that and make it load the librairies from googleapis site, so the line would be :

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>

If that's possible where should I modify the line code?

Regards.
User avatar
Senior Boarder

teitbite
Sat Jan 05, 2013 3:11 am
Reply with quote
Report this post
Hi

Our template's code is loading jQuery from external site. I think this one is being loaded by a 3rd party extension. Please locate which extension is that and check if this can be changed in it's configuration.
User avatar
Moderator

GK User
Sat Jan 05, 2013 1:46 pm
Reply with quote
Report this post
teitbite wrote:Hi

Our template's code is loading jQuery from external site. I think this one is being loaded by a 3rd party extension. Please locate which extension is that and check if this can be changed in it's configuration.

Hi teitbite and thanks for your reply..

Perhaps, if you check the original quickstart package of the gk_publisher for joomla 3.0 downloaded from here, you'll figure out that the jsquery.min.js used comes from the original folder : /media/jui/js/jquery.min.js

Site calls for:

Code: Select all
  <script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>
  <script src="/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
  <script src="/media/jui/js/bootstrap.min.js" type="text/javascript"></script>


All of the 3 files are delivered with the template in that same folder, so I doubt it is another component, plugin or module calling it.

I may be mistaken, if that is so can you please help me figure out which component or plugin or module calls out that file?

Live site is : http://tourisme.nadorpresse.com

Regards.
User avatar
Senior Boarder

teitbite
Sun Jan 06, 2013 12:27 am
Reply with quote
Report this post
Hi

I was checking with a template installed along with a clean joomla not a quickstart. But this is a good observation. It may point to one of the extensions installed in our demo. Please check K2 settings for start. I believe there were a selection of jQuery install location there.
User avatar
Moderator

GK User
Sun Jan 06, 2013 12:32 am
Reply with quote
Report this post
teitbite wrote:Hi

I was checking with a template installed along with a clean joomla not a quickstart. But this is a good observation. It may point to one of the extensions installed in our demo. Please check K2 settings for start. I believe there were a selection of jQuery install location there.

I don't use K2, I desinstalled the component :)
User avatar
Senior Boarder

teitbite
Sun Jan 06, 2013 12:53 am
Reply with quote
Report this post
Hi

Ok. It was just a guess. None of our products is using jQuery, but I know K2 does and we are using it for every quickstart. Please send me an access to Your joomla panel. I'll make some more tests.
User avatar
Moderator

GK User
Sun Jan 06, 2013 12:57 am
Reply with quote
Report this post
teitbite wrote:Hi

Ok. It was just a guess. None of our products is using jQuery, but I know K2 does and we are using it for every quickstart. Please send me an access to Your joomla panel. I'll make some more tests.

Hi, done, please let me know if you need anything else.
User avatar
Senior Boarder

teitbite
Sun Jan 06, 2013 3:41 pm
Reply with quote
Report this post
Hi

I've been to Your joomla panel and I must say I do not know some of the extensions You have installed. I've been trying to unpublish them one by one and see when loading of jQuery will gone, but it's always loading. My quess is that it's comming from AcyMailing component (or from one of the plugins - there is too many of them to check them all). So if You really want see if I'm right You will need to uninstall AcyMailing and check than. If it's not the answer than You need to try with plugins.

There is a faster method of finding the source of it. Please run a search inside files looking for a path to jquery. When You will know which file is responsible for loading it than changing the source or resognising extension responsible will be easy. Unfortunately I cannot do this without an access to Your server.
User avatar
Moderator

GK User
Sun Jan 06, 2013 4:02 pm
Reply with quote
Report this post
teitbite wrote:Hi

I've been to Your joomla panel and I must say I do not know some of the extensions You have installed. I've been trying to unpublish them one by one and see when loading of jQuery will gone, but it's always loading. My quess is that it's comming from AcyMailing component (or from one of the plugins - there is too many of them to check them all). So if You really want see if I'm right You will need to uninstall AcyMailing and check than. If it's not the answer than You need to try with plugins.

There is a faster method of finding the source of it. Please run a search inside files looking for a path to jquery. When You will know which file is responsible for loading it than changing the source or resognising extension responsible will be easy. Unfortunately I cannot do this without an access to Your server.


Hi,

I have already been there trying to deactivate the plugins and components to find out which one is responsible for loading the local jquery file, with no success... I have desinstalled acymailing just in case, but the file is still being called.

But just like I said in the previous post, the local file in question comes with the quickstart package, if a 3rd party component or plugin or module was loading the file neither of the /media/jui/js/ folder or file jquery.min.js would be included in the package!

My guess is that the template provided in the quickstart package do call for the local file instead of the external one like the demo site does! We need to local the code calling the file (external or local) and take a look at it!
User avatar
Senior Boarder

teitbite
Sun Jan 06, 2013 4:25 pm
Reply with quote
Report this post
Hi

Template does not call it. When You download a simple template package this file is not there. So looks like it's comming from joomla itself (???).

Yeap :) I've just downloaded Joomla_3.0.2-Stable-Full_Package.zip and file is there.

Sorry for so late solving the issue. J3 is relatively new and I've just made couple of projects with it. Had no need to deal with jQuery there.
User avatar
Moderator

GK User
Sun Jan 06, 2013 4:34 pm
Reply with quote
Report this post
Hi, again,

Just like i doubted, the code calling for jquery.min.js in the local folder is in this file (included in the quickstart package) : libraries/cms/html/jquery.php

The code line is (around line 54) :

Code: Select all
      JHtml::_('script', 'jui/jquery.min.js', false, true, false, false, $debug);


Now if I change that with :

Code: Select all
      JHtml::_('script', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', false, true, false, false, $debug);


The problem is then fixed.

So I'm wondering, if that modification to the core won't cause any kind of problems, if any doubts would it be better to use a plugin like 'JB Libary' which does the same and replaces the jquery librairy sources?

Regards.
User avatar
Senior Boarder

teitbite
Sun Jan 06, 2013 4:40 pm
Reply with quote
Report this post
Hi

It will not bring any problems but since it's a joomla file it can be rewritten to the previous version during any joomla update. Unfortunately from the code You've provided it's clear that there is no configuration option in joomla which can changed it permanently.
User avatar
Moderator

GK User
Mon Jan 07, 2013 10:57 pm
Reply with quote
Report this post
teitbite wrote:Hi

It will not bring any problems but since it's a joomla file it can be rewritten to the previous version during any joomla update. Unfortunately from the code You've provided it's clear that there is no configuration option in joomla which can changed it permanently.


Hi,

So unless Joomla in a coming update changes that code line, the better solution is to use JB library or some similar plugin in order to avoid a manual modification after each Joomla update :)

Thanks for your time..

Regards.
User avatar
Senior Boarder

teitbite
Tue Jan 08, 2013 8:32 pm
Reply with quote
Report this post
Hi

Sorry I cannot confirm, because I do not know JB library plugin :)

Anyway I would keep the local version of jQuery becuase of performance reasons it's always better to have the file You can compress and so on than an additional url refference. Of course everything depends from what You need it for.
User avatar
Moderator


cron