Topic: Toaster is throwing an error

Abhayjeet Singh free asked 5 years ago

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 tell me what is the problem.  I am using following code:

<!DOCTYPE html>
<html lang="en">

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Material Design Bootstrap</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="">
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="css/mdb.min.css" rel="stylesheet">
<!-- Your custom styles (optional) -->
<link href="css/style.css" rel="stylesheet">



<!-- Start your project here-->

<a class="btn btn-info btn-lg" id="alert-target" >Click me!</a>

<!-- /Start your project here-->

<!-- SCRIPTS -->
<!-- JQuery -->

<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<!-- Bootstrap tooltips -->
$("#alert-target").click(function () {
toastr["info"]("I was launched via jQuery!")

<script type="text/javascript" src="js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>


Jakub Strebeyko staff answered 5 years ago

Hi Abhayjeet,

There are few things in the code that could use a little improvement. First, the linting issues: font-awesome link (line 10) is not properly closed (a &gt; character entity instead of >). There is a closing </script> tag before any opening one (line 31). Except for that, if you start with a .html file inside the /html/ directory, the file paths are missing the ../ part (necessary to go one directory up and then seek files in /css and /js directories), they should look something like this: <link href="../css/mdb.min.css" rel="stylesheet"> or <script type="text/javascript" src="../js/mdb.min.js"></script&gt;. Getting rid of these few issues allows the button to really shine and toastr around.

With Best Regards,

Please insert min. 20 characters.


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



Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No