ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Installing jQuery

August 01, 2008 2:37am

Subscribe [10]
  • #1 / Aug 01, 2008 2:37am

    sorenk

    8 posts

    How do I install jQuery? I have been reading in this Forum and on jQuery.com as well in the book “Learning jQuery”. I have however not been able to find any information that can help me on which directory to put in jQuery. Next, do I need to turn anything of or on to make jQuery work?

  • #2 / Aug 01, 2008 2:44am

    Ingmar

    29245 posts

    It doesn’t matter. You can basically install it anywhere you want, as long as you link to it correctly. I’ve begun to use the Google AJAX API on a number of projects recently:

    <sc*ipt src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></sc*ipt>

    You don’t need to turn on anything else, no.

  • #3 / Aug 01, 2008 3:50am

    George Ornbo

    272 posts

    Like Ingmar many people are linking to the files on Google’s servers as this has the advantage of caching the file for many of your visitors.

    You can also install the file on your local server. Put the js file is a /js/ folder and then link to it using

    <scr*pt type="text/javascript" src="/js/jquery-1.2.6.pack.js"></scr*pt>

    Then you need to create some JavaScript that uses jQuery. Personally I create another file in /js/. Make sure you include this file *after* the jQuery script. So it might look something like this:

    <scr*pt type="text/javascript" src="/js/jquery-1.2.6.pack.js"></scr*pt>
    <scr*pt type="text/javascript" src="/js/onDomLoad.js"></scr*pt>

    Put some code in the onDomLoad.js file to check it is working

    $(document).ready(function() {
    alert("Look Mum, I'm using jQuery!");
    });

    Reload the page and if the alert shows jQuery is ready to use!

    * Note as the EE forums strip out script tags make sure you change the sc*pt to script in the above code examples!

  • #4 / Aug 01, 2008 5:13am

    Sean C. Smith

    3818 posts

    Does google have the jQuery plugins as well?

  • #5 / Aug 01, 2008 5:16am

    Ingmar

    29245 posts

    No, it doesn’t. Really, there are way too many there for that, I suppose.

  • #6 / Aug 06, 2008 5:54pm

    Riverboy

    2993 posts

    This looks interesting. Does that googlelinking need anything to do to from admin, i mean do i have to install Metaweblog API or something.

    This is total new for me but im interested as i said.
    What basics runs from “googleting”? hide/show?

    And what aboot the EE2.0, does jQuery somehow come “along” with it?

    Cheers:
    - Tuittu

  • #7 / Aug 06, 2008 6:10pm

    Ingmar

    29245 posts

    When you use jQuery you need to link to it, either locally or by making use of a public site like Google. This is precisely what we do here. Any additional plugins you might need you have to upload and link to in the usual way. We know that EE 2.0 will use jQuery for it’s interface, but no details are known yet.

  • #8 / Aug 07, 2008 5:16am

    Riverboy

    2993 posts

    Ok. I need to look up how much of my site users dont use java before i start to “love” this =)

    Oh, noticed that users have to allow javascript? of course…that i dont find from Google Analytics, there is only “java”.

    Thanks fot da info. googlelinking works fine with few tests i made last night (our local time).

  • #9 / Aug 21, 2008 1:34pm

    Todd D.

    460 posts

    Java and javascript are unrelated. You don’t need Java to run javascripts. The only thing they share is a name similarity.

  • #10 / Aug 21, 2008 3:01pm

    4flix

    88 posts

    What is the benefit or drawbacks of linking to jquery at google rather than local? 

    Wouldn’t linking it from an external server potentially slow the site down and have other unintended “repercussions?”

    Just curious.

  • #11 / Aug 21, 2008 6:17pm

    Sean C. Smith

    3818 posts

    What is the benefit or drawbacks of linking to jquery at google rather than local? 

    Wouldn’t linking it from an external server potentially slow the site down and have other unintended “repercussions?”

    Just curious.

    linking it at google has the benefit that if many other sites are also doing it, then the file is already likely to be in the users cache thus increasing the speed of your site since they won’t have to download it again.

  • #12 / Aug 21, 2008 8:38pm

    4flix

    88 posts

    That makes a whole lot of sense.

    Thanks Sean.

  • #13 / Aug 22, 2008 3:44am

    Ingmar

    29245 posts

    There are other advantages: you don’t have to install it locally yourself, and Google updates to new versions, too.

  • #14 / Oct 23, 2008 7:32am

    Riverboy

    2993 posts

    Ingmar, but then you need to update the link also what you might use to point into google when google updates their library?

  • #15 / Oct 23, 2008 9:07am

    Arun S.

    792 posts

    Does google have the jQuery plugins as well?

    It does have some. jQuery hasn’t put it up themselves.  The plugin authors have.  So it’s up to the plugin author.  There isn’t any organized or concerted effort to do so.

    Ariel Flesler’s plugins are, for example.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases