JQuery Error: "$ is undefined"

I am using an extended version of Lightbox called SexyLightbox. It uses jQuery as its structure. When I initialize it, I get this error with regular inverse values, when the lightbox is not working and an infinite number of times when I try to show the image:

Error: $ is undefined
Source File: http://bagelstreet.se/sexylightbox/sexylightbox.v2.3.jquery.min.js
Line: 12

The initialization of the script is as follows:


    <link rel="stylesheet" href="sexylightbox/sexylightbox.css" type="text/css" media="all" />

    <script type="text/javascript" src="sexylightbox/jquery.min.js"></script>
    <script type="text/javascript" src="sexylightbox/jquery.easing.1.3.js"></script>

    <script type="text/javascript" src="sexylightbox/sexylightbox.v2.3.jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function(){
          SexyLightbox.initialize({color:'black', dir: 'sexyimages'});
        });
    </script>

UPDATE So - I replaced the library, I am using the unpacked version of sexylightbox. FireBug points to an error in the jQuery.bind () function, specifically in bold:


jQuery.bind = function(object, method){
  var args = Array.prototype.slice.call(arguments, 2);  
  return function() {
    var args2 = [this].concat(args, $.makeArray( arguments ));  
    return method.apply(object, args2);  
  };  
};  

Used jQuery version 1.3.2.

Any thoughts on what might happen?

solvable

The problem was the encoding error for the SexyLightbox author code. Used by $ in jQuery.bind () to $.

+3
4

- sexylightbox.v2.3.jquery.min.js $ undefined. , , $ jQuery. sexylightbox.v2.3, Packer. , Firebug, , .

+5
0

, - Content-Type. , jquery.min.js , sexylightbox.v2.3.jquery.js : application/x-javascript. , application/x-javascript?

0

, .

:

use files that seem to work ... maybe this will help you ...

0
source

Source: https://habr.com/ru/post/1730219/


All Articles