Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Script only working in Chrome

Hi all,

I have just finished building a home page (using chrome as a browser). I started doing some cross-browser testing, to see if the website looks consistent on the other browsers.

Element placement is consistent, however none of my jQuery scripts or plugins are working in Safari or FireFox (these work perfectly in chrome). I have javascript enabled in all browsers, with the development tools not showing any errors.

My personal script is not complicated in the slightest, with the other jQuery plugin being a popular carousel script (slick).

Any ideas as to where I could be going wrong? Google searches have been unsuccessful.

Here's my Script tags :

<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
  <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
  <script src="js/jquery.nav.js"></script>
  <script type="text/javascript" src="js/slick/slick.min.js"></script>
  <script>
      $(document).ready(function(){
        $('.slider').slick({
            dots: true,
            infinite: true,
            speed: 500,
            fade: true,
            cssEase: 'linear',
            autoplay: true,
            autoplaySpeed: 7000,
          });
      });
  </script>

This is my own script for a burger icon (jquery.nav.js) :

$(".btn-menu").click(function(){
              $(this).toggleClass("btn-menu-open");
              $(".nav").slideToggle(800);
          });

Thanks in advance, Matt

1 Answer

Simple solution in the end...

I Just needed to use the most up to date jQuery CDN

Oh I feel silly!

Better to ask and answer yourself than to not ask at all... (I do this all the time. I will remember about updating.)