Uncaught TypeError: Object #<Object> has no method 'movingBoxes'

前端 未结 10 623
既然无缘
既然无缘 2020-12-08 19:06

Im trying to use the movingBoxes plugin with my asp.net mvc site and it is not working (obviously). I have the movingboxes.js imported in my head tag in the site.master lik

相关标签:
10条回答
  • 2020-12-08 19:52

    When I had this problem it was because I was trying to use an actual function in place of an anonymous function.

    Incorrect:

    $(document).on('change', "#MyId", MyFunction());
    

    Correct

    $(document).on('change', "#MyId", MyFunction);
    

    or also correct and if you need to pass event object or other params.

    $(document).on('change', "#MyId", function(e) { MyFunction(e); });
    
    0 讨论(0)
  • 2020-12-08 19:54

    I just had this same problem with the jquery Responsive Slides plugin (http://responsive-slides.viljamis.com/).

    I fixed it by not using the jQuery short version $(".rslides").responsiveSlides(.. but rather the long version: jQuery(".rslides").responsiveSlides(...

    So switching $ to jQuery so as not to cause conflict or using the proper jQuery no conflict mode (http://api.jquery.com/jQuery.noConflict/)

    0 讨论(0)
  • 2020-12-08 19:56

    Please keep in mind that only a few elements can be self-closing, most others have to be closed through adding an explicit end tag. In the above case, the first script tag was not closed properly, the end script tag of the second script then closed the script section, causing only the first script to be loaded as external script source and ignoring the second script.

    More info about which tags can be self-closed, have a look at the W3C drafts for HTML5 (although the definition was no different in earlier HTML-versions):

    http://www.w3.org/TR/html5/syntax.html#end-tags (8.1.2.1, Point 6)

    0 讨论(0)
  • 2020-12-08 20:00

    Actually i think that you have downloaded just a part of the script. Try to check 'Core' checkbox before download the whole script in jquery site.

    0 讨论(0)
提交回复
热议问题