Comments (4)
The front page of this project has installation instructions, and they're effectively the same as for every other 3rd-party jquery plugin: "directly download the repository and place the content of dist wherever you can access them." i.e. download this repo, copy the contents of its "dist" folder to somewhere in your HTML tree, and include the js and css files in your HTML exactly as is done for any js/css files.
from jquery-toast-plugin.
I've followed the exact steps therefore I have:
- added jQuery as pre-requisite
- installed the plugin via npm
- included the CSS and JS with their CDN ("You can simply download the repo or if you are in rush the minified CSS or non-minified CSS can be found and minified JS and non minified JS can also be found.")
- did
$.toast('Toast message to be shown')
, as the instructions say
However, I still get an error in the console:
Uncaught TypeError: $.toast is not a function
at index.js:10
I've also tried to add it as a function for a click event attached to one of my HTML elements, obviously with no success.
I am aware that the step that might be missing is potentially a basic or fundamental one that has nothing to do with 3rd party plugins. I do think that at least referencing to more general instructions--which I'm guessing is what I'm missing--would ideally complement 3rd party plugins' instructions.
Thanks for your response.
from jquery-toast-plugin.
Solved!
The links for the CDNs don't work. I won't submit a PR because the README specifies to "report" bugs or features. In any case, the CDNs can be found here: https://www.cdnpkg.com/jquery-toast-plugin
Thanks @sgbeal for your help and quick responses.
from jquery-toast-plugin.
The best place to start is to look at the source code for the demo site linked to on the project home page. That demonstrates everything you need to include, and in which order (it sounds to me like you are including jquery after the plugin). Simply open the demo site and use your browser's "view source" option, then go through that line by line.
from jquery-toast-plugin.
Related Issues (20)
- Width of toast HOT 4
- Toast does not maintain mid/center position on window resize
- Not working with angularJs
- Wrong 'afterHidden' function work when many toasts
- Plugin is broken in IE 8 HOT 1
- Remove Green LoadBar HOT 1
- Change title or translation of the alert
- Update request for new Bootstrap 4.2.1
- Toast goes outside of the window when set to top-right with icon
- Don't hide toast on hover or touch HOT 1
- can we keep the old sticky toasts still if current toasts are more than the stack number?
- change text size HOT 1
- $.toast is not a function HOT 2
- Responsive toast msgbox not working
- hideAfter - after update not working HOT 1
- Tag newest version
- Feature Requests: Pause the Loader (Close) on hover and Close the toast on click anywhere inside
- u
- Feature Request: Specify a width of the toast
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-toast-plugin.