Reference error: Variable was not defined

1

Why does the variable have an error in a fiddle (-> link < -) does not display this error? Can it be anything other than Js libraries? For all have already been defined
(Code that when clicking, rotates the image)

var value = 0
$("#image").rotate({
  bind: {
    click: function() {
      console.log(value);
      value += 90;
      $(this).rotate({
        animateTo: value
      })
    }
  }

});
#image {
  margin: 100px 100px;
}
<script src="http://beneposto.pl/jqueryrotate/js/jQueryRotateCompressed.js"></script><scriptsrc="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script src="https://raw.githubusercontent.com/wilq32/jqueryrotate/master/jQueryRotate.js"></script><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<img src="https://www.google.com/images/srpr/logo3w.png"id="image">
    
asked by anonymous 25.09.2017 / 21:06

1 answer

1

Just reverse the order of the script calls, and call jQuery first.

So:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><scriptsrc="http://beneposto.pl/jqueryrotate/js/jQueryRotateCompressed.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script><scriptsrc="https://raw.githubusercontent.com/wilq32/jqueryrotate/master/jQueryRotate.js"></script>
<img src="https://www.google.com/images/srpr/logo3w.png"id="image">
    
25.09.2017 / 21:16