- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我正在使用 Toastr 2.1
JavaScript 库来显示 transient 用户输入验证错误消息。我将 preventDuplicates
选项设置为 true。它不起作用——当用户快速连续单击验证按钮时,我仍然看到重复的消息(点击速度比“超时”快)。
这是我的 toastr 默认值:
function getDefaults() {
return {
tapToDismiss: true,
toastClass: 'toast',
containerId: 'toast-container',
debug: false,
showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
showDuration: 300,
showEasing: 'swing', //swing and linear are built into jQuery
onShown: undefined,
hideMethod: 'fadeOut',
hideDuration: 1000,
hideEasing: 'swing',
onHidden: undefined,
extendedTimeOut: 1000,
iconClasses: {
error: 'toast-error',
info: 'toast-info',
success: 'toast-success',
warning: 'toast-warning'
},
iconClass: 'toast-info',
positionClass: 'toast-top-right',
timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
titleClass: 'toast-title',
messageClass: 'toast-message',
target: 'body',
closeHtml: '<button>×</button>',
newestOnTop: true,
preventDuplicates: true,
progressBar: false
};
}
我是否需要进行任何其他更改以防止出现重复的错误消息?
最佳答案
这可能有帮助
toastr.options = {
"preventDuplicates": true,
"preventOpenDuplicates": true
};
toastr.error("Your Message","Your Title",{timeOut: 5000});
关于javascript - 重复的 toastr 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27365538/
如何在 toastr 中显示多行错误消息? 我已经格式化了我的错误消息,如下所示 "Please fix the following: \r\nFirst Name is required\r\nLa
在 toastr 消息中,我有几个图标在彼此之上。这是它的样子: 我的代码很简单,我在 Ajax 调用后使用 toastr: success : function(reponse) {
有什么办法可以改变吗?我尝试将 toastClass 定义为不透明度设置为 1 的类,但没有看到任何变化: .toast-style{ opacity: 1; } toastr.options.
我正在使用 ngx-toastr图书馆。我正在启动位于屏幕顶部中央的消息,如下所示: @Injectable() export class MessageService { construct
我正在使用 Angular toastr 并且我坚持在隐藏上一个 toastr 和显示下一个 toastr 之间传递延迟。一次应该只有一个 toastr 。我隐藏并显示它,但没有视觉差异,并且 toa
我正在使用 toastr jquery 插件。下面是链接 https://github.com/scottoffen/jquery.toaster 我在这里面临两个问题 目前点击按钮时会显示多个通知(
我正在尝试 toastr,但我不断收到一个奇怪的 TypeError,这对我来说没有任何意义。 TypeError: Cannot read property 'extend' of undefine
我正在使用 angular2-toaster在我的 Angular 应用中 很简单, 在组件模板中定义 toastr 容器 并且您使用 ToasterService 类型的 toasterServi
我想使用toastr来通知用户。我已关注this设置指南。但我收到错误消息:Uncaught TypeError: toastr is not a function。我查看了网络选项卡,文件加载正确。
我正在尝试将 toastr 带入我的应用程序中。我做了一些非常简单的事情: bundles.Add(new ScriptBundle("~/Content/example-scripts")
shared.module.ts import { animate, state, style, transition, trigger } from '@angular/animations'; i
我在 Angular 6 中使用 ngx-toastr 进行 http 错误通知,就像在 httpInterceptor 中注入(inject) ToastrService export cl
我安装了react-toastr并集成了示例代码。 import React from 'react' import { ToastContainer } from 'react-toastr'; c
下面的代码会弹出一个 toastr : function showMessage(code, type) { ConfigService.getErrorMessage(cod
我正在使用 typescript 创建一个非常简单的 Web 应用程序。现在,它要做的就是创建一个矩形并显示该区域的信息提示。不幸的是, toast 从未出现。该代码行已执行,并且 Internet
我喜欢用 toastr 做的事情,但我似乎无法让它发挥作用。 来自官方页面... (1) Link to toastr.css (2) Link to toastr.js (3) Use toastr
从应用程序注销后,我必须显示 toastr 。这就是我正在尝试的。在这里,我在注销方法后调用 toastr 。 _this.logout().then({ success: function (r
我是 Angular js 的新手。我正在尝试显示错误消息 View toaster() .我在谷歌上搜索,但没有找到正确的结果。当我点击 cancel()按钮,我会收到一条错误消息,提示 toast
我正在尝试使用 Toastr 通知 ( https://github.com/CodeSeven/toastr )。它们工作正常,但问题是它们只出现在右上角。我可以更改位置的任何内容,但它们将始终显示
我正在使用 toastr js 插件 - toastr - 并更改了 css 颜色,但是,我不知道如何创建正确的 png/base64 部分? 原文: .toast-info { backgrou
我是一名优秀的程序员,十分优秀!