Topic: Use toastr alert on load

pbeks priority asked 6 years ago


Hi, is there a way to manipulate the toastr object without triggering the click() method of the buttons?I want to display a warning or error toast when the Session variable error or warning is set then I want to use the Value of error or warning as message. Anyone with some example or snippet ? Thanks in advance

pbeks priority answered 6 years ago


That solved the problem, Thanks.


This should work:

$(function () {
    toastr["info"]("Welcome!");
});

pbeks priority commented 6 years ago

Sorry, I am new to this, how do I call Function from PHP then? Suppose I open index.php and have set Session var "error" to "Some Error text" and on load of the page display a TOASTR with the error text?

Bartłomiej Malanowski staff commented 6 years ago

Could you please show us your existing code?


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 jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags