你相信确认吗? [英] Do You Believe in Confirm?

查看:87
本文介绍了你相信确认吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在大卫弗拉纳根的书中读到了Javascript The Definitive Guide

以下内容参考了警报,确认和提示的使用。


虽然这些对话方法非常简单易用,但是好的设计要求你谨慎使用它们,如果有的话。对话框

这样的盒子不是网络范例的常见功能,而且现在更有能力的网络浏览器已经变得不那么常见了。
支持文档内容本身的脚本...


您是否同意此声明?如果是这样,让我们​​假设您想要确认删除操作
。你如何在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

推荐答案

在2007年5月11日星期五08:20:25 -0700,MikeC写道:
On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:

我在大卫弗拉纳根的书中读到了Javascript The Definitive Guide

以下参考使用警报,确认和提示。


尽管这些对话方法非常简单易用,但是

好的设计要求你谨慎使用它们,如果有的话。对话框

这样的盒子不是网络范例的常见功能,而且它们已经变得不那么常见了,因为更强大的网络浏览器支持

脚本文件内容本身......


您是否同意这一陈述?如果是这样,让我们​​假设您想要确认删除操作
。你如何在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.



是的。我从未使用过这些功能。仅仅是个人偏好,不是那么多,而是你不应该这样做。意见。


编写确认表格的代码几乎没有区别

并使用javascript对话框确认。

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.


5月11日下午4:20,MikeC< mcrav ... @ att.netwrote:
On May 11, 4:20 pm, MikeC <mcrav...@att.netwrote:

我在大卫弗拉纳根的书中读到了Javascript The Definitive Guide

以下是关于使用警报,确认和提示的内容。


虽然这些对话方法非常简单易用,

好​​的设计要求你谨慎使用它们,如果有的话。对话框

这样的盒子不是网络范例的常见功能,而且现在更有能力的网络浏览器已经变得不那么常见了。
支持文档内容本身的脚本...


您是否同意此声明?如果是这样,让我们​​假设您想要确认删除操作
。你如何在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



这取决于你是谁以及你是谁正在努力实现。

就个人而言,我更喜欢浮动div的外观和感觉,你可以根据自己的心灵内容定制。

显然,自定义div的类会占用相当多的空间,而这个空间很简单:

var answer = confirm(继续? );


如果您的脚本非常简单,或只是简单确认

说,提交表单,那么我相信标准确认

对话框就足够了。如果您正在编写一个更大,更多的b $ b b复杂脚本,例如 https ://www.youos.com/ 已经做过例如。我认为标准对话框可能看起来不合适,并且主题

确认框可能是有序的,这可能会给出多个$

选项可供选择。


我们还需要考虑速度。当然,现在几乎每个人都在这个网上拥有快速的宽带,但是在拨号连接上还有很多

的人。我们编写的代码越多,加载页面所需的时间越长,b / b
可能变得越激动。我们不能拒绝这些人,因为它适合我们,我们可以吗?也许我们可以,这让我回到原点。

这一切都取决于你想要达到的目标。


另外,有一点需要注意:使用标准确认对话框,浏览器

将被有效冻结,直到进程被终止,或确认

对话框已被回答。有时这种效果是可取的,其他

次,它不是。


希望我没有说过任何愚蠢的话。


祝福。


Daz。

It depends on who you are and what you are trying to achieve.
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.


5月11日,8: 26日,Ivan Marsh< anno ... @ you.nowwrote:
On May 11, 8:26 am, Ivan Marsh <anno...@you.nowwrote:

On Fri,2007年5月11日08:20:25 -0700,MikeC写道:
On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:

我在David Flanagan的书Javascript The Definitive Guide中读到了

,其中涉及使用alert,confirm和prompt。
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..."


您同意这个结论吗?如果是这样,让我们​​假设您想要确认删除操作
。你如何在web-

友好中做到这一点?办法。
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.



是的。我从未使用过这些功能。仅仅是个人偏好,不是那么多,而是你不应该这样做。意见。


编写确认表格代码几乎没有区别

并使用javascript对话框确认。


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.



Ivan,


我认为使用确认的异议是双重的。首先,它弹出

一个对话框,这是非Web应用程序中的普通用户界面。但网上有人b $ b,人们不喜欢突然出现在单独的窗口中。

另一个可能的反对意见 - 虽然我当然不知道这一点 -

是这些是模态控件,这意味着你不能做任何事情

else,直到你以某种方式回复。


您如何处理确认表格?你把它显示为另一个

帧吗?感谢您的意见。

Ivan,

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.


这篇关于你相信确认吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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