I am working on SPA, using handlebars (as a templating framework) and Sammy.js. There is an issue, i.e, some of the animations that need jquery, are not working properly, unless the page is refreshed. These animations only works when i put there relevant jquery/javascript code in the template... well it seems like it cannot access that script from its separate file...
the heirarchy of including my script files is this:
IN HEAD PORTION:
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/docs.min.js" type="text/javascript"></script>
<script src="js/scripts.js" type="text/javascript"></script>
<script src="js/superfish.min.js" type="text/javascript"></script>
<script src="js/jQueryTab.js"></script>
<script src="js/jquery.bxslider.js"></script>
IN BODY AT THE END:
<script src="js/sammy.js"></script>
<script type="text/javascript" src="js/handlebars-v1.3.0.js"></script>
<script type="text/javascript" src="js/sammy.handlebars.js"></script>
<script src="js/singlePageAppScript.js"></script>
<!--<script type="text/javascript" src="js/myScriptTestTmpl2.js"></script> -->
<!--<script type="text/javascript" src="js/script.js"></script>-->
<script type="text/javascript" src="js/rootURL.js"></script>
<script src="js/vendor/jquery.ui.widget.js"></script>
<script src="js/jquery.iframe-transport.js"></script>
<script src="js/jquery.fileupload.js"></script>
<script type="text/javascript" src="select2-3.4.5/select2.js"></script>
I tried to solve this issue by changing the heirarchy of these files. but issue did not resolved.
Before it was making more issues, that are solved by making some of my scripts running on window.load event instead of running on document.ready.
Please help me out of this problem. Thanks