如何显示“JAlert”多次弹出?
我知道我可以调用 alert('Warning1');alert('Warning2');
它将显示 2 个警报。但是,当我使用 JAlert 页面 我无法显示多条警报消息。你们中有人使用过这个插件并解决了同样的问题吗?
I know I could call alert('Warning1');alert('Warning2');
and it will show 2 alerts. But, when I use JAlert plugin referred in JAlert Page I can't show multiple alert messages. Does any of you guys ever worked with this plugin and solved same problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的-所以我制作了一个示例 HTML 并测试了这个东西
所以基于网站的文档
好的,现在这是 jQuery 文档的逻辑
实际发生的情况
结论
该插件无法在内部处理多个调用,并且回调是错误的!因为它不是回调,而是在调用自身之前调用函数或等待初始 jAlert 被接受
解决方案
为什么要使用alert();然后工作吗??!?!?!?!?
因为当您调用
alert();
时,代码执行会停止并等待,直到您按“确定”并继续执行代码。所以我很遗憾地说,这个插件无法正常运行,我建议您找到另一个插件。
Right- so i made a sample HTML and tested this thing out
So based on the docuemntation from the website
Ok now this is the logic of the jQuery
What actually happens
In conclusion
This plugin cannot handle multiple calls internally and the callback is wrong! because it is not calling back but calling a function before it calls its self or waits for the inital jAlert to be accepted
Solution
Why Does alert(); work then??!?!?!?!?
Because when you call
alert();
the code execution STOPS and waits until you press OK and continues the code.So i am sorry to say but this plugin is not functioning properly and i suggest you find another one maybe.
我遇到了同样的问题并这样解决:
在 jquery.alerts.js 中,就在公共函数的注释之前,我插入了以下内容:
这个想法是,如果先前的对话框仍然打开,我们将调用推送到数组中,以便在对话框关闭时使用。
现在我们仍然需要在 _show() 函数的开头添加一行:
对于五个 .click() 处理程序,我们需要在调用回调后添加这一行:
就这样!
我想更新创建者的信息,但无法在他的网站上发表评论......
我正在使用此处演示的精彩版本,它使用标准主题。太棒了!
I had the same problem and solved it like this:
in the jquery.alerts.js, just before the comment for public functions, I have inserted this:
The idea is that if a previous dialog is still open, we push the call into array, to be used when the dialog is closed.
Now we still need to add a line to the beginning of the _show() function:
And for the five .click() handlers we need to add this line after calling the callback:
That's all!
I wanted to update the creator but there was no way to leave a comment in his site...
And I am using the wonderful version demonstrated here which uses standard themes. Just great!
前面的答案部分正确,但未能定义保存多个警报的数组($.alerts.waitingCalls)。下面的代码替换了整个 jquery.alerts.js(整个包位于: http://code.google.com/p/jalert-plus/downloads/list)
The previous answer was partially correct but failed to define the array that holds the multiple alerts ($.alerts.waitingCalls). The code below replaces the entire jquery.alerts.js (the entire package is available at: http://code.google.com/p/jalert-plus/downloads/list )