toastr[type] is not a function
See original GitHub issueHi, I’m trying to call toastr like this:
var showToastr = function (msg, type) {
return toastr[type](msg);
};
var type = 'info';
var message = 'Test';
showToastr(message, type);
and it works but console prints error:
Uncaught TypeError: toastr[type] is not a function
Can you give me an advice how to deal with that? I’d like to avoid any errors in console.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Getting error "toastr is not a function error" when trying to use ...
But I get the error message: Uncaught TypeError: toastr is not a function . I have looked at the network tab and the...
Read more >How to resolve the error 'TypeError: $.toast is not a function' in ...
Basically, this error tells you that the element you were trying to select was not found (hence, it cannot find the “style” property...
Read more >Uncaught TypeError: $(...).toast is not a function
Sometimes we get an error Uncaught TypeError: $(...).toast is not a function in the console using the toast() method in the HTML page....
Read more >Toaster is throwing an error - Material Design for Bootstrap
I am getting an error i.e., $.toaster is not a function while using toaster I don't know how to fix it so please...
Read more >toaster clear does not work inside a jQuery function - Edureka
The error - "TypeError: $.toast is not a function" is telling you that the method toast() is not present in your JS file....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In my case it happened due to jQuery slim.
@rodrigogs Thank you,you the best