Topic: How to implement jQuery with MDB Standard Pro

IT_Santini priority asked 2 years ago


Expected behavior Can use MDBPro properly with jQuery, according to documentation, we have to add it to our project on our own https://mdbootstrap.com/docs/standard/components/toasts/#docsTabsAPI Can you please give an example on how to do it?

Actual behavior Uncaught TypeError: $(...).toast is not a function

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/it_santini/3827451#html-tab-view In this snippet I've added external asset jQuery version 3.6.0


Dawid Wajszczuk staff answered 2 years ago


Hi.

I see no errors with the code from your snippet. However, changing position via jQuery seems to not work. A proper task has been added and we will take a closer look at this case. As for now I suggest using JS instead. Here is the snippet: https://mdbootstrap.com/snippets/standard/d-wajszczuk/3835814#js-tab-view.

Keep coding,
Dawid


IT_Santini priority commented 2 years ago

From example you gave , you are not using toast with jquery, I need example to use mdbtoast with jQuery, please can you provide me some example?


Dawid Wajszczuk staff commented 2 years ago

As I have mentioned before, currently toast is not working properly with jQuery. We will try to fix this, but for now you need to use vanilla JavaScript.


Dawid Wajszczuk staff answered 2 years ago


Hi,

You just need to add jQuery via CDN or NPM and it should work. Sometimes you need to use $(document).ready() function. Here is the working example of chips https://mdbootstrap.com/snippets/standard/d-wajszczuk/3829179#js-tab-view.

Keep coding,
Dawid


IT_Santini priority commented 2 years ago

Hi, could you please re-produce snippet using toast, because I keep getting the same error message, I have updated my snippet also https://mdbootstrap.com/snippets/standard/it_santini/3827451#js-tab-view



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.11.0
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows 10 64bit
  • Provided sample code: No
  • Provided link: Yes