Solved

How to load jquery twice?

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
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.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now