Solved

How to load jquery twice?

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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)

695 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