Solved

How to load jquery twice?

Posted on 2014-12-18
3
111 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

Title # Comments Views Activity
Using SQL to Generate XML from Large Dataset 80k+ rows 7 48
Clean URL from GET variables 2 113
video playback resume on webpages 2 79
ColdFusion Rereplace 3 82
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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.

829 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