gpt4 book ai didi

javascript - pnotify 拒绝工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:45:51 26 4
gpt4 key购买 nike

我从 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
});
});

但它一直给我错误

Uncaught TypeError: Object function (e,t){return new v.fn.init(e,t,n)} has no method 'pnotify'

最愚蠢的事情是 im visual VS 2012 并且在开发环境中它向我显示 pnotify 作为智能感知的“$”函数!

我做错了什么?

最佳答案

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

主要.js:

requirejs.config({
paths: {
pnotify: "/Static/plugins/pnotify/pnotify.custom.min"
}
});

通知.js

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

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

关于javascript - pnotify 拒绝工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15090058/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com