模态对话框没有线程在Firefox中休眠? [英] Modal dialog doesn't threads to sleep in Firefox?

查看:63
本文介绍了模态对话框没有线程在Firefox中休眠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于代码发布在

< http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/bf33c7bbb9f699f9/0336cb59fb5920c5>


我刚注意到去年我没注意到的另一件事(除了我的

接口bug :-)


我看起来像Firefox window.confirm没有把setTimeout

" threads"在睡觉。脚本始终如一地执行。我认为

(尚未测试)window.alert / window.prompt也是这样做的。


我意识到窗口没有记录,并且setTimeout不是

记录和ta-ta-ta。仍然是恕我直言*最令人期待的*行为IMHO

是由IE和Opera演示的: - 所有线程都在睡觉,直到

你关闭对话框。


我想知道这个Firefox的行为是否有意并在任何地方提到



Yet about the code posted at
<http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/bf33c7bbb9f699f9/0336cb59fb5920c5>

I just noticed another thing I did not notice last year (besides my
interface bug :-)

I looks like in Firefox window.confirm does not put setTimeout
"threads" on sleep. Script keeps executing as never nothing. I presume
(did not test yet) that window.alert / window.prompt do the same.

I realize that "window is not documented, and setTimeout is not
documented and ta-ta-ta". Still IMHO *the most expected* behavior IMHO
is that demonstrated by IE and Opera:- all threads are sleeping until
you dismiss the dialog.

I''m wondering if this Firefox behavior is intentional and mentioned
anywhere?

推荐答案

VK写道:
我意识到窗口没有记录,并且没有记录setTimeout和ta-ta-ta。仍然恕我直言*最令人期待的*行为IMHO
是由IE和Opera演示的: - 所有线程都在睡觉,直到
你关闭对话框。
I realize that "window is not documented, and setTimeout is not
documented and ta-ta-ta". Still IMHO *the most expected* behavior IMHO
is that demonstrated by IE and Opera:- all threads are sleeping until
you dismiss the dialog.




我刚刚测试了你所说的内容,在我看来Firefox的行为

更好。如果我启动一个计时器,无论发生了什么,我都要

它继续运行直到我告诉它停止。


确认/ alert / prompt应该只中断运行的
当前代码,而不是所有进程。看一下JavaScript参考资料

(不是手册)并查看它的内容。

-

Jonas Raoni Soares Silva http://www.jsfromhell.com




Jonas Raoni写道:

Jonas Raoni wrote:
我刚刚测试了你所说的内容,在我看来,Firefox的行为更好。如果我启动一个计时器,无论发生了什么,我都希望它继续运行直到我告诉它停止。


这不是一个好/坏的问题,而是一个

一致性的问题。具有10-100个线程。在关闭对话框后,单个警报会将FF

和IE移动到完全不同的时间范围。

以编程方式更有利于什么 - 它当然高度依赖

当前任务。我个人认为Firefox的行为更像是成人看。同时JavaScript没有真正的*线程*

管理和同步,就像在Java中一样,所以对我来说似乎是一个很危险的决定,特别是对于多个定时的实例

方法。

无论如何都不能做太多。尽管如此,这是非常好的。所以我猜b $ b猜测有跨浏览器的FF行为需要使用DHTML小部件

。对于跨浏览器的IE / Opera / Co行为,需要停止

allthread在显示对话框之前手动 - 并在之后手动恢复



很棒......!@#
I''ve just tested what you said and in my opinion the Firefox behaviour
is better. If I start a timer, it doesnt matter what''s happening, I want
it to keep running until I tell it to stop.
It is not really a question of better/worse, but a question of
consistency. With 10-100 "threads" running, a single alert will move FF
and IE to completely different time frames after dialog is closed.
What is more benefitial programmatically - it highly depends of course
on the current task. I personally consider Firefox behavior as more
"adult looking". At the same time JavaScript doesn''t have real *thread*
management and synchronization like in Java, so seems like a rather
dangerous decision to me especially for multiple timed instance
methods.
Not too much one can do anyway. It''s great good to know though. So I
guess to have cross-browser FF behavior one needs to use a DHTML widget
instead. And for cross-browser IE/Opera/Co behavior one needs to stop
all "thread" manually before showing a dialog - and manually resume
them after.
Just great ... !@#

%.. 。

查看JavaScript参考资料
(不是手册)并查看它的内容。
% ...
Take a look on the JavaScript reference
(not manuals) and check what it says.




我做了,包括mozilla.org。同样11岁的宝宝说话多年来一遍又一遍地说:这个窗口有这些按钮并返回

,这个窗口有那些按钮和。等。似乎没有点改变

自JavaScript 1.0


澄清请求。



I did, including mozilla.org. The same 11-years-old baby talk going
over and over for years: "this window has these buttons and returns
that, this window has those buttons and.. etc." Not a dot seems changed
since JavaScript 1.0

I think I''ll ask at bugzilla: not as a bug report, but as a
clarification request.


这篇关于模态对话框没有线程在Firefox中休眠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆