Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation instructions #47

Open
eduardoltorres opened this issue Dec 28, 2018 · 4 comments
Open

Installation instructions #47

eduardoltorres opened this issue Dec 28, 2018 · 4 comments

Comments

@eduardoltorres
Copy link

eduardoltorres commented Dec 28, 2018

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
Copy link

sgbeal commented Dec 28, 2018

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.

@eduardoltorres
Copy link
Author

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.

@sgbeal
Copy link

sgbeal commented Dec 28, 2018

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.

@eduardoltorres
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants