Solved

How to load jquery twice?

Posted on 2014-12-18
3
112 Views
Last Modified: 2014-12-18
I am kind of new to the web development space. One of the things that gets me a little confused is when using someone else's plugin/code to enhance my site.

For example, trying to add a calendar or gallery to my site that is using foundations. The foundations loaded theirs at the bottom. Some of the plugins i downloaded recommended loading theirs at the top by the header.
Some sites recommends it to always be at the bottom.

Question : How do i best load jquery when there is a need to include multiple versions, and one calls for it to be at the top, and one calls for it to be at the bottom? I am considering moving the bottom one to the top, and just use the one. But i am not sure if the different version will break my page somehow.
0
Comment
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40507843
need to include multiple versions
You only load the jquery library once, and it's preferable to have it before your closing BODY tag along with any plugins, unless there is a specific reason for it to run during the page load.
0
 

Author Comment

by:NeverEndingFlashStories
ID: 40507870
Thanks, when it seems like there is a need for multiple versions, do i just load the newest one and see what happens then? What if one or more of the plugins break? I have seen a .noconflict solution suggested, but I can't seem to implement it correctly.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40507879
You can use the noconflict to assign one library to a different identifier but in general it's a bad idea - just use the latest version - 1.x.x for IE8 support or 2.x.x if you only support modern browsers
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

685 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