Search code examples
javascriptanythingslider

Javascript loading locally but not on server


I have looked at similar threads but have yet to find a solution to this problem.

The website is working perfectly on my local machine (Mac), but I have uploaded a website via FTP (hosted by 1&1) and when I view the site in the browser (latest Chrome/Firefox/Safari) the scripts are not loading for the image slider (AnythingSlider).

View the website

Apologies if this is answered elsewhere.


Solution

  • line 155 :

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    
    <script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
    

    line 20:

    <script src="js/libs/jquery-1.7.2.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
    

    Don't include jQuery twice. The jquery on line 155 is being included after anythingslider. So it is resetting the jquery object ( It no longer has anythinslider). remove this line 155 jquery and change line 34 like this

    <script>    
        $(document).ready(function(){
            $('#slider').anythingSlider();
        });
    </script>