toast_close.html 967 B

1234567891011121314151617181920212223242526272829303132
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. </head>
  7. <body>
  8. <script>
  9. (function () {
  10. var msg = {:json_encode($toastMsg)};
  11. try {
  12. var p = window.parent && window.parent !== window ? window.parent : window;
  13. if (p.Toastr && typeof p.Toastr.warning === 'function') {
  14. p.Toastr.warning(msg);
  15. } else if (window.Toastr && typeof window.Toastr.warning === 'function') {
  16. window.Toastr.warning(msg);
  17. } else if (p.Layer && typeof p.Layer.msg === 'function') {
  18. p.Layer.msg(msg, {icon: 0, time: 2500});
  19. }
  20. if (p.Layer && typeof p.Layer.getFrameIndex === 'function') {
  21. var idx = p.Layer.getFrameIndex(window.name);
  22. if (idx != null) {
  23. p.Layer.close(idx);
  24. }
  25. }
  26. } catch (e) {
  27. try { alert(msg); } catch (e2) {}
  28. }
  29. })();
  30. </script>
  31. </body>
  32. </html>