简体   繁体   English

Javascript错误:未捕获的TypeError:未定义不是函数

[英]Javascript Error: Uncaught TypeError: undefined is not a function

I am trying to resolve the issue .I cant load this script http://orangeplacehotel.com/superbudget/ems-policy . 我正在尝试解决此问题。我无法加载此脚本http://orangeplacehotel.com/superbudget/ems-policy Is there anything wrong with this code?? 这段代码有什么问题吗? I tried putting alert and it works properly but still i cant see the plug-in loaded on the site.. Please help .. Thanks, 我试着放警报,它可以正常工作,但仍然看不到该站点上加载的插件。.请帮助..谢谢,

 $(function() { $('#nanoGallery1').nanoGallery({ kind:'flickr', userID:'129251189@N05', touchAutoOpenDelay: -1, breadcrumbAutoHideTopLevel: true, maxWidth: 948, imageTransition : 'slide', thumbnailWidth: 200, thumbnailHeight: 126, thumbnailHoverEffect: 'scaleLabelOverImage,borderDarker', i18n: { thumbnailImageDescription: 'view photo', thumbnailAlbumDescription: 'open album' }, thumbnailLabel: { display: true, position: 'overImageOnMiddle', hideIcons: true, align: 'center' }, thumbnailLazyLoad: true }); }); alert("test"); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 

error is "NanoGallery is not a function" I think you should check your plugin (in what nanoGaller() is defined) is included in page or not before running your code 错误是“ NanoGallery不是函数”,我认为您应该在运行代码之前检查页面中是否包含插件(定义了nanoGaller())。

Below is the code working fine Its not a solution but might give you some idea 下面是可以正常工作的代码,它不是解决方案,但可能会给您一些帮助

First include the jquery library then 首先包括jQuery库,然后

$.prototype.nanoGallery = function(){
    console.log(arguments);
}

$(function() {
    $('#nanoGallery1').nanoGallery({
        kind:'flickr',
        userID:'129251189@N05',
        touchAutoOpenDelay: -1,
        breadcrumbAutoHideTopLevel: true,
        maxWidth: 948,
        imageTransition : 'slide',
        thumbnailWidth: 200,
        thumbnailHeight: 126,
        thumbnailHoverEffect: 'scaleLabelOverImage,borderDarker',
        i18n: {
            thumbnailImageDescription: 'view photo',
            thumbnailAlbumDescription: 'open album'
        },
        thumbnailLabel: {
            display: true,
            position: 'overImageOnMiddle',
            hideIcons: true, align: 'center'
        },
        thumbnailLazyLoad: true 
    });

});

alert("test");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未定义的typeerror未定义不是javascript中的函数 - uncaught typeerror undefined is not a function in javascript Javascript Uncaught TypeError:undefined不是函数 - Javascript Uncaught TypeError: undefined is not a function 未捕获的TypeError:undefined不是javascript中的函数 - Uncaught TypeError: undefined is not a function in javascript 未定义的typeerror未定义不是javascript中的函数 - uncaught typeerror undefined is not a function in javascript 未捕获的TypeError:undefined不是函数-Javascript - Uncaught TypeError: undefined is not a function - Javascript 错误:未捕获的类型错误:未定义不是函数 - Error: Uncaught TypeError: undefined is not a function Javascript 函数错误未捕获的类型错误:无法设置未定义的属性“目标” - Javascript function error Uncaught TypeError: Cannot set property 'target' of undefined Javascript JQuery Listview刷新错误消息-未捕获的TypeError:undefined不是函数 - Javascript JQuery Listview Refresh Error Msg - Uncaught TypeError: undefined is not a function 试图用JavaScript计时,出现错误,Uncaught TypeError:undefined不是函数 - Trying to make a clock in JavaScript, getting an error, Uncaught TypeError: undefined is not a function 使用noobslider和mootools的“未捕获的TypeError:未定义的函数” JavaScript错误 - “Uncaught TypeError: undefined is not a function” JavaScript error using noobslider and mootools
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM