Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How to add jQuery to Joomla 1.5
Old 07-29-2011, 01:55 AM How to add jQuery to Joomla 1.5
TWD
TWD's Avatar
King Spam Talker

Posts: 1,190
Trades: 0
This is how I did it.
Your mileage may vary.

1) You'll need to open up the index.php Joomla file
in a text editor. The file can be found in whatever theme folder
is currently your default.

2) Add these lines of code :

Code:
<script type="text/javascript" src="http://www.google.com/jsapi"></script>

<script type="text/javascript">google.load("jquery", "1.6.1");</script><!--Added Google Library javascript-->
immediately before the

Code:
<jdoc:include type="head" />
You should now have jQuery running on your page.
If you have Firefox with the FireBug extension, you can test
it by cache refreshing your Joomla Homepage (Ctrl + F5),
opening Firebug (F12), and testing the jQuery version
as described in another post here: http://tycoontalk.freelancer.com/jav...y-version.html

This approach uses the Google API JavaScript library rather
than downloading and installing your own version of jQuery.

Why it's best practice.

a) You are getting a compressed version of jQuery (17KB instead of about 80KB)
b) Parallel downloading the library speeds your page load time
c) Fair chance the user already has the Google jQuery file cached in their
browser. More and more developers are taking the same approach.
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE

Last edited by TWD; 07-29-2011 at 01:57 AM..
TWD is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-02-2011, 02:44 PM Re: How to add jQuery to Joomla 1.5
Novice Talker

Posts: 12
Trades: 0
I can see the minified jQuery (1.6 version) is 89.2 KB. How come it can be so less? i.e 17KB?

Does google further compress the minified version of jquery?
rahmancbe is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to add jQuery to Joomla 1.5
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37660 seconds with 12 queries