• Resolved boborg

    (@boborg)


    Can anybody explain why a script only works when I make a function in my theme functions.php to use the jquery from Google (1.10.2)?

    So it works with
    <script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js?ver=1.10.2'></script>

    But it does not work with
    <script type='text/javascript' src='http://mysiteurl/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Probably because the default WordPress jQuery library is “no conflict mode” (look here for all details).

    If your script starts with this:

    $(document).ready(function(){
        // ...code here...

    Then you’ll need to change it to this if you use WordPress’ default jQuery library:

    jQuery(document).ready(function($) {
        // ...code here....
    Thread Starter boborg

    (@boborg)

    Thank you very much for the explanation

    anonymized-11892634

    (@anonymized-11892634)

    Been struggling with this for ages, thanks boborg!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Script only works when using Google library jquery?’ is closed to new replies.