I'm developing a site and for page transitions, using $ .get () from JQuery and just change the center of the index.html, without the page reloading. However, some features of the code snippets that I include require scripts, which are also used in index.html, but for them to work, I must include them again in the snippet of code I am including. I'm having a big problem with this because there are some conflicts.
An example: I use a script to do something in my header to work. When I add a code snippet (from a $ .get () at runtime) that will also use that same script, it does not "catch" this script, so I have to include it in it separately ( and repeatedly). However, when I include, there is conflict, such as repetition of effects and the like.
What should I do to avoid having to do this?
EDITED:
Upon request, I put parts of the code that are having the conflict.
INDEX.HTML
<!doctype html>
<html>
<head>
...
...
</head>
<body>
<div class="conteudo">
<!-- AQUI É ONDE É SUBSTITUIDO O TRECHO PUXADO PELO $.get() -->
</div>
</body>
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.bxslider.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script><scriptsrc="js/owl.carousel.js"></script>
<script src="js/modernizr.js"></script>
<script type="text/javascript" src="js/skrollr.min.js"></script>
<script src="js/functions.js"></script>
<script src="controller/controle.js"></script> <!-- SCRIPT RESPONSÁVEL POR CONTROLAR O MENU E LEVAR OS TRECHOS DE CÓDIGO PARA A DIV CONTEUDO -->
</html>
Having the index.html, shown above, I have .html files, such as "main.html", "contact.html", which are called by this code snippet in control.js
$.get("view/principal.html", function(view){
$("#conteudo").html(view);
});
The pagination works perfectly, however, if any element coming from the next files uses some of the index.html scripts, they do not catch. For this, I have to add this snippet in all .html that I add in the content div:
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.bxslider.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script><scriptsrc="js/owl.carousel.js"></script>
<script src="js/modernizr.js"></script>
<script type="text/javascript" src="js/skrollr.min.js"></script>
<script src="js/functions.js"></script>
However, when I add this section, "fixed" features of index.html, which use index.html's own scripts, start having conflicts, such as repeating effects and not working some features.