1

i am using require.js for my project and unable to load the "jquery-visible" plugin, i configured the path correctly with jquery.visible.min

require.config({
    paths: {

        'jquery': "../kendo/js/jquery.min",

        'dependency':"../jquery-visible-master/jquery.visible.min"
    },

and defining the dependency like this

define(
    [
         "jquery"

         ,"dependency"

    ],
    function (
         $

       ,dependency

    ) 

when i use the dependency to call the jquery function(.visible) it is saying .visible() is not a function

$("#bookmark-5").visible() ;

error message in console : 456 Uncaught TypeError: $(...).visible() is not a function

Need Help
  • 23
  • 6

1 Answers1

1

Try to use next config:

require.config({
    paths: {
        jquery: "../kendo/js/jquery.min",    
        dependency :"../jquery-visible-master/jquery.visible.min"
    },
    shim: {
        dependency: ["jquery"]
    }
Vladimir Posvistelik
  • 3,843
  • 24
  • 28
  • Vladimir, in your paths and shim objects you don't use quotes on the property names, am I doing it wrong if I use quotes? – Mike Devenney Nov 03 '15 at 21:31
  • 1
    @MikeDevenney, no - that's fine. Moreover - seems like you're right. Check this discussion - http://stackoverflow.com/questions/4201441/is-there-any-practical-reason-to-use-quoted-strings-for-json-keys – Vladimir Posvistelik Nov 03 '15 at 21:35
  • Thanks for the link, I hadn't done much digging yet as I just started using the library as part of a new project. Good to know! – Mike Devenney Nov 03 '15 at 21:42