pnotify 拒绝工作

Sto*_*orm 5 javascript jquery

我从Pines Notify下载了 pnotify jquery 插件

简而言之,它告诉我添加所需的 js 和 css 文件,并且在文档准备好后,以下应该可以工作!

$(document).ready(function() {
    $.pnotify({
        type: 'error',
        title: 'Errors found in form',
        text: 'Please check all form data, some items were invalid.',
        opacity: 0.95,
        hide:false,
        history: false,
        sticker: false
    });    
});
Run Code Online (Sandbox Code Playgroud)

但它只是不断给我错误

未捕获的类型错误:对象函数 (e,t){return new v.fn.init(e,t,n)} 没有方法 'pnotify'

最愚蠢的是,我在 Visual VS 2012 中,在开发环境中,它向我展示了 pnotify 作为“$”函数的智能感知!

我可能做错了什么?

小智 0

有了PNotify2.01,就可以和reguirejs一起使用

main.js:

requirejs.config({
   paths: {
      pnotify: "/Static/plugins/pnotify/pnotify.custom.min"
   }
});
Run Code Online (Sandbox Code Playgroud)

通知.js

define(['pnotify'], function () {
  return {
     SimpleNotice: function () {
        return new PNotify('Check me out! I\'m a notice.');
     }
  };
});
Run Code Online (Sandbox Code Playgroud)

我从我的生产代码(Durandal 框架)中复制了这个