kamranahmedse / jquery-toast-plugin

Highly customizable jquery plugin to show toast messages
http://kamranahmed.info/toast
1.51k stars 506 forks source link

Installation instructions #47

Open etorres07 opened 5 years ago

etorres07 commented 5 years ago

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.

sgbeal commented 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.

etorres07 commented 5 years ago

I've followed the exact steps therefore I have:

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.

sgbeal commented 5 years ago

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.

etorres07 commented 5 years ago

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.