0

I am using JA_Orisite template of joomla2.5 for my client, and unable to load jquery file "//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"(needed for menu and article scrollings, etc), This file was being loaded on localhost, when I transfered the site using akeeba backup and recovery process, after installation on server I am unable to load jquery.

Surprisingly, I was having file permission issues on server, once I set 777 to all the files of my site, Jquery file was also working properly.

As the first server is not providing me the expected speed and service, I have transfered the site to other hosting server, which is now giving the same problem of jquery, On this server too I tried to set the permissions to 777, and yet unable to load jquery files.

pega wega
  • 809
  • 8
  • 13

1 Answers1

0

Rather than importing it from Google, you could always import a local version like so:

<?php
  // load jQuery, if not loaded before
  if(!JFactory::getApplication()->get('jquery')){
     JFactory::getApplication()->set('jquery',true);
     $document = JFactory::getDocument();
     $document->addScript(JURI::root() . "templates/template_name/js/jquery.js");
  }
?>
Lodder
  • 19,758
  • 10
  • 59
  • 100
  • i have added the above said code in index.php of root folder, but still unable to get the functionality of JQuery. – pega wega Oct 03 '13 at 17:02
  • no, you don't add it in the index.php of the root. add it to the index.php of your template folder – Lodder Oct 03 '13 at 17:26
  • I have tried by adding the above code at the end of inddex.php of my_template folder. Once I added the above code, even home page was unable to load. – pega wega Oct 05 '13 at 16:40
  • There must have been a mistake when adding it. It needs to be added to the top of the index.php file. Don't forget to remve the `` tags – Lodder Oct 05 '13 at 17:35
  • Can you provide a link to your site please? Oh and you did chane the path in the code I provided pointing towards wherever YOU have jQuery loaded yes? – Lodder Oct 09 '13 at 07:21
  • Can you copy everything from your *index.php* file onto a [PasteBin](http://pastebin.com/) so I can have a look? – Lodder Oct 09 '13 at 16:12
  • pasted with name as "pega wega" – pega wega Oct 09 '13 at 16:18
  • I have already seen your site, I need a link to the code on PasteBin with your index.php code – Lodder Oct 09 '13 at 17:42
  • Right, I see your using the T3 framework, not something I'm a fan of at all. Try putting the code on line 21 instead (under `defined ( '_JEXEC' ) or die ( 'Restricted access' ); `) – Lodder Oct 09 '13 at 17:58
  • I have tried by keeping your code at line 21 as said, Still i cant get the solution. can you provide me ur email address where I can send the snapshots of tags inside when the site is browsed from localhost and server – pega wega Oct 09 '13 at 18:02
  • Ok download and install the [jQuery Easy](http://extensions.joomla.org/extensions/core-enhancements/performance/jquery-scripts/18327) plugin – Lodder Oct 09 '13 at 18:04
  • In that case I can't recommend anything else. I have no idea why code that I have used on my own website and provides for other people doesn't work, nor does a plugin that has thousands of downloads. I t should work but there is something seriously wrong with your website – Lodder Oct 09 '13 at 18:31
  • made some parameter changes "enable jquery : jqueryUI" in the plugin, now Iam able to display atleast the headlines scrollings with animation.... 50% of the work is done, now the menu has to look after – pega wega Oct 09 '13 at 18:36
  • Thanks a lot @Lodder, Your answer helped me out, when I have gone through the scripts loading from my localhost, there were 2 js files missing out, one was "jquery1.7.js" and the other from some "t3-assets folder", So I have tried to load those two file externally as you suggested in the main answer of this post, and finally I have reached the solution with your help, Thanks Again... :) :) – pega wega Oct 10 '13 at 09:20
  • @pegawega - You're welcome, glad you finally got it working. Please mark the answer as correct as it has now been resolved ;) – Lodder Oct 10 '13 at 09:36