Giter Club home page Giter Club logo

Comments (4)

sgbeal avatar sgbeal commented on May 27, 2024 1

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.

eduardoltorres avatar eduardoltorres commented on May 27, 2024 1

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.

eduardoltorres avatar eduardoltorres commented on May 27, 2024 1

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.

sgbeal avatar sgbeal commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.