Solved

Installing jQuery plugins

Posted on 2008-11-03
5
4,514 Views
Last Modified: 2010-04-21
Hi,
I would like to install the cookie plugin from http://plugins.jquery.com/project/cookie, but I am loading jQuery from Google http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery, so is there a way to use the cookie plugin while still using googles jQuery?
0
Comment
Question by:Daduck
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:dwaynecharrington
ID: 22865846
You might be happy to know that jQuery plugins are simply a matter of including the Javascript file for it.

<script src="jquery.cookie.js"></script>

Make sure you include the script after you've included jQuery. So in order of preference jQuery should be included first and then the plugin afterwards.
0
 
LVL 6

Accepted Solution

by:
dwaynecharrington earned 500 total points
ID: 22865852
And if you're including jQuery from Google it's absolutely fine. As long as jQuery is being included okay, it's all good. Just include any jQuery plugin as you would jQuery itself!
0
 

Author Closing Comment

by:Daduck
ID: 31512631
Thank you very much, it worked wonders.
0
 

Expert Comment

by:eliuha
ID: 24949645
so what does it mean , when after doing the specified, i get
---------
function (selector, context) {
    return new (jQuery.fn.init)(selector, context);
}
--------

instead of getting a cookie value ( var nFrom = $.cookie('nId'); )
0
 

Expert Comment

by:eliuha
ID: 24950020
nevermind,
a complete reload of a page (ctrl +f5) fixed it
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now