Open etorres07 opened 5 years ago
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.
I've followed the exact steps therefore I have:
$.toast('Toast message to be shown')
, as the instructions sayHowever, 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.
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.
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.
I think the installation instructions could be a bit more detailed or at least reference to external resources. For those of us starting out it isn't so clear how to set it up. I've been trying to install it for an hour now with no success. Perhaps a response to this post might suffice as well.
Thanks in advance.