Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to load jquery twice?

Posted on 2014-12-18
3
Medium Priority
?
119 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
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.
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:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

609 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