SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scripts that use jQuery (confused)

    Hey guys,

    I'm a bit confused. So I have downloaded like 5 different scripts that do different things, and they each usually come with their own jquery.js file. I thought jquery.js was a library built with JavaScript, so why can't I just use one jquery.js file?

    Do people who make jquery scripts typically edit the jquery.js file? Why isn't there one standard jquery.js file that all people can reference? Or is it the case that each of my scripts uses a different version of jquery?

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,183
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    The reason they include the jQuery file is because that's the file they built there plugin with, more or less what it could mean is that unless you use either the copy they supplied or a newer version the plugin won't work.

    The main reason its there is because new users may not know what version of jQuery to use so they supply the correct file for you.
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle

  3. #3
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So people don't make changes to the jquery.js files, right? Anyway, I've seen things like "jquery_002.js", "jquery_003.js" and "jquery_004.js" all included in the same package. Why do they use so many jquery files instead of combining them into one .js? Do multiple files load faster than one bigger file?

  4. #4
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,183
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Personally i have never seen the jquery_002.js thing you have before, the only thing i have seen is developers including jquery.min.js or jquery-1.4.4.min.js for example in their packages.
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle

  5. #5
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohh, I saw that as well. What is that about? Is it like a snippet of the jQuery library?

  6. #6
    Forums Designer
    Join Date
    Jun 2004
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is minified version. It is exactly the same as normal file, but without extra spaces and comments, reducing its file size.

    You can just use latest one. Currently its 1.6.1, which you can download from jquery.com. It is backwards compatible with old versions, so if your scripts are written for old versions of jQuery, they should work with 1.6.1 without problems.

    Or you can just link to http://code.jquery.com/jquery-latest.min.js that always uses latest version.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •