本文是小编为大家收集整理的关于你相信确认吗?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。
问题描述
我读过 David Flanagan 的《Javascript The Definitive Guide》一书
下面参考alert、confirm、prompt的使用.
"虽然这些对话框方法极其简单易用,
好的设计要求你谨慎使用它们,如果有的话.对话
像这样的盒子不是网络范式的共同特征,而且
现在,功能更强大的网络浏览器已经变得不那么常见了
支持文档内容本身的脚本编写..."
你同意这个说法吗?如果是这样,让我们假设您想要
确认删除操作.您如何在"网络"中执行此操作-
友好"方式.
谢谢,
Mike
推荐答案
2007 年 5 月 11 日星期五 08:20:25 -0700,MikeC 写道:
我读过 David Flanagan 的《Javascript The Definitive Guide》一书是的.我从来没有使用过这些功能.纯属个人喜好,并非如此
下面参考alert、confirm、prompt的使用.
"虽然这些对话框方法极其简单易用,
好的设计要求你谨慎使用它们,如果有的话.对话
像这样的盒子不是 web 范式的共同特征,它们
现在已经变得不那么普遍了,因为功能更强大的网络浏览器支持
文档内容本身的脚本..."
你同意这个说法吗?如果是这样,让我们假设您想要
确认删除操作.您如何在"网络"中执行此操作-
友好"大大地.
很多"你不应该这样做"意见.
编写确认表单的代码几乎没有区别
并使用 javascript 对话框确认.
5 月 11 日下午 4:20,MikeC <mcrav...@att.net 写道:我读过 David Flanagan 的《Javascript The Definitive Guide》一书这取决于你是谁以及你想要达到的目标.
下面参考alert、confirm、prompt的使用.
"虽然这些对话框方法极其简单易用,
好的设计要求你谨慎使用它们,如果有的话.对话
像这样的盒子不是网络范式的共同特征,而且
现在,功能更强大的网络浏览器已经变得不那么常见了
支持文档内容本身的脚本编写..."
你同意这个说法吗?如果是这样,让我们假设您想要
确认删除操作.您如何在"网络"中执行此操作-
友好"方式.
谢谢,
麦克风
就个人而言,我更喜欢浮动 div 的外观和感觉,您
可以根据你的内心定制.
显然,自定义 div 的类会占用相当大的空间
更多的空间,一个简单的:
var answer = confirm("继续?");
如果您的脚本非常简单,或者只是简单的确认
说,提交一个表格,然后我相信标准确认
对话框就足够了.如果你正在写一个更大的,更多
复杂的脚本,例如 https://www.youos.com/ 已经完成了.我
觉得标准的对话框可能会显得格格不入,还有一个主题
确认框可能是有序的,可能会提供多个
选项可供选择.
我们还需要考虑速度.当然,几乎所有人都在
现在的互联网宽带很快,但还是有很多
人们在那里拨号连接.我们写的代码越多,
他们加载页面花费的时间越长,他们就越激动
可能成为.我们不能仅仅因为它适合就将这些人拒之门外
我们,可以吗?也许我们可以,这让我回到了我原来的观点.
这一切都取决于您想要实现的目标.
另外,需要注意的一件事:使用标准确认对话框,浏览器
被有效冻结,直到进程被杀死,或者确认
对话已回答.有时这种效果是可取的,其他的
有时,它不是.
希望我没有说太愚蠢的话.
最好的祝福.
Daz.
5 月 11 日上午 8 点 26 分,Ivan Marsh <anno...@you.now 写道:2007 年 5 月 11 日星期五 08:20:25 -0700,MikeC 写道:伊万,我读过 David Flanagan 的《Javascript The Definitive Guide》一书
下面参考alert、confirm 和prompt 的使用."虽然这些对话框方法极其简单易用,
好的设计要求你谨慎使用它们,如果有的话.对话
像这样的盒子不是 web 范式的共同特征,它们
现在已经变得不那么普遍了,因为功能更强大的网络浏览器支持
文档内容本身的脚本......"你同意这个说法吗?如果是这样,让我们假设您想要
确认删除操作.您如何在"网络"中执行此操作-
友好"大大地.
是的.我从来没有使用过这些功能.纯属个人喜好,并非如此
很多"你不应该这样做"意见.
编写确认表单的代码几乎没有区别
并使用 javascript 对话框确认.
我认为反对使用确认是双重的.首先,它弹出
一个对话框,它是非 Web 应用程序中的普通用户界面.但是
在网络上,人们不喜欢东西弹出到单独的窗口中.
另一个可能的反对意见 - 虽然我不确定 -
是不是这些是模态控件,意味着你什么都做不了
否则,除非您以某种方式回复.
您如何处理确认表?你把它显示为另一个
框架?感谢您的意见.
问题描述
I read in the book Javascript The Definitive Guide by David Flanagan
the following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and
they have become much less common now that more capable web browsers
support scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Thanks,
Mike
推荐答案
On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:
I read in the book Javascript The Definitive Guide by David Flanagan theYes. I''ve never used these features. Just a personal preference, not so
following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and they
have become much less common now that more capable web browsers support
scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
much a "you shouldn''t do it" opinion.
There''s virtually no difference in the code to write a confirmation form
and using the javascript dialog confirmation.
On May 11, 4:20 pm, MikeC <mcrav...@att.netwrote:I read in the book Javascript The Definitive Guide by David FlanaganIt depends on who you are and what you are trying to achieve.
the following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and
they have become much less common now that more capable web browsers
support scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Thanks,
Mike
Personally, I prefer the look and feel of a floating div, which you
can customise to your hearts content.
Obviously, the class for a customised div would take up considerably
more space that a simple:
var answer = confirm("Continue?");
If your script is seriously simple, or just a simple confirmation for
say, submitting a form, then I believe that the standard confirm
dialog will suffice. If you are writing a much larger, and more
complex script, like https://www.youos.com/ have done for example. I
think that the standard dialog box may look out of place, and a themed
confirmation box might be in order, that perhaps gives more than one
option to choose from.
We also need to take speed into account. Sure, almost everyone on the
internet these days has fast broadband, but there are still lots of
people out there on dialup connections. The more code we write, the
longer it takes them to load a page, and the more agitated they are
likely to become. We can''t just shut out these people because it suits
us, can we? Perhaps we can, which brings me back to my original point.
It all depends on what you want to achieve.
Also, one thing to note: With the standard confirm dialog, the browser
is effectively frozen until the process is killed, or the confirmation
dialog has been answered. Sometimes this effect is desirable, other
times, it''s not.
Hope I haven''t said anything too dumb.
Best wishes.
Daz.
On May 11, 8:26 am, Ivan Marsh <anno...@you.nowwrote:On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:Ivan,I read in the book Javascript The Definitive Guide by David Flanagan the
following in reference to the use of alert, confirm, and prompt."Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and they
have become much less common now that more capable web browsers support
scripting of the document content itself..."Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Yes. I''ve never used these features. Just a personal preference, not so
much a "you shouldn''t do it" opinion.
There''s virtually no difference in the code to write a confirmation form
and using the javascript dialog confirmation.
I think the objection to using confirm is two-fold. First, it pops up
a dialog which is a normal user interface in non-web applications. But
on the web, people don''t like things popping up into separate windows.
The other possible objection - although I don''t know this for sure -
is that these are modal controls, meaning that you can''t do anything
else until you reply in some way.
How do you handle a confirmation form? Do you display it as another
frame? Thanks for your input.