kartik-v / yii2-widgets

Collection of useful widgets for Yii Framework 2.0
http://demos.krajee.com/widgets
Other
558 stars 175 forks source link

notify_*** is not defined when call setFlash #382

Open phanngocphuongbac opened 4 years ago

phanngocphuongbac commented 4 years ago

Prerequisites

Steps to reproduce the issue

  1. call a Yii::$app->session->setFlash('success','Register is success')
  2. reload page with javascript

Expected behavior and actual behavior

When I follow those steps, I see

(index):1111 Uncaught ReferenceError: notify_3611c307 is not defined at (index):1111 (anonymous) @ (index):1111 setTimeout (async) (anonymous) @ (index):1111 mightThrow @ jquery.js:3557 process @ jquery.js:3625 setTimeout (async) (anonymous) @ jquery.js:3663 fire @ jquery.js:3291 fireWith @ jquery.js:3421 fire @ jquery.js:3429 fire @ jquery.js:3291 fireWith @ jquery.js:3421 ready @ jquery.js:3901 completed @ jquery.js:3911

at (index):1111: setTimeout(function () {$.notify({"message":"Register is success","icon":"glyphicon glyphicon-ok-sign","title":"Success!","url":"","target":"_blank"}, notify_3611c307);}, 500);

I was expecting show alert

Environment

Browsers

Operating System

Libraries

Isolating the problem

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/90806447-notify_-is-not-defined-when-call-setflash?utm_campaign=plugin&utm_content=tracker%2F530581&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F530581&utm_medium=issues&utm_source=github).