Solved

Installing jQuery plugins

Posted on 2008-11-03
5
4,519 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

691 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