Closed erikasland closed 6 years ago
Getting the same error with https://cdnjs.cloudflare.com/ajax/libs/pnotify/3.0.0/pnotify.min.js
Have recently updated from PNotify 2.0.0 to 3.0.0 using a bundle generated via http://sciactive.com/pnotify/ and am getting this problem
Getting the same problem as @nicklello. Please comment if you find a solution.
Do you have multiple copies of jQuery on the page?
Am Getting the same error.
I have the same issue, downloaded pnotify with all modules from here @djmattyg007 i only have included one jquery
try this
window.PNotify = require('pnotify/src/pnotify');
pnotify.custom.min.js is what you would use if you had downloaded the file from the demo page. If you're installing it with NPM, you need to include the files in the dist
directory instead.
If anyone has a different problem, can you share your code, and I will take a look?
I tried to use cdn that mentioned @KrishnaPG <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pnotify/3.0.0/pnotify.min.js"></script>
and this script in index.html.
<script type="text/javascript">
function init_PNotify() {
if( typeof (PNotify) === 'undefined'){ return; }
new PNotify({
title: "PNotify",
type: "info",
text: "Welcome. Try hovering over me. You can click things behind me, because I'm non-blocking.",
nonblock: {
nonblock: true
},
addclass: 'dark',
styling: 'bootstrap3',
hide: false,
before_close: function(PNotify) {
PNotify.update({
title: PNotify.options.title + " - Enjoy your Stay",
before_close: null
});
PNotify.queueRemove();
return false;
}
});
};
init_PNotify();
</script>
it worked without error.
I first installed PNotify using NPM like so...
npm install pnotify --save
It shows that it installed fine in my packages.json file...
"pnotify": "^3.0.0"
I then put these two in my head like so...
<head><script type="text/javascript" src="pnotify.custom.min.js"></script> <link href="pnotify.custom.min.css" media="all" rel="stylesheet" type="text/css" /></head>
I am getting the following error in my console in my google dev tools...
GET http://localhost:8000/pnotify.custom.min.js
When I call something like this using my jQuery...
$(document).ready(function(){ $(function(){ new PNotify({ title: 'Regular Notice', text: 'Check me out! I\'m a notice.' }); }); })
And am getting the following...
Uncaught ReferenceError: PNotify is not defined
GET http://localhost:8000/pnotify.custom.min.css
Is this a bug, or am I just a noob? I would really like to use your product for a project I am doing if you could help me get it working. Thank you.