正在连接可用性组 错误_5种常见的可用性错误以及避免这些错误的解决方案

正在连接可用性组 错误

I'm sort of a grumpy web user, but I think that's part of what drives me to be a good Web Developer.  I get so annoyed at things that make using a website difficult, things that should be basic.  Here's a list of five common usability mistakes and solutions for avoiding them.  Do yourself and your users a favor and make sure you aren't breaking any of these rules.

我有点脾气暴躁,但我认为这是促使我成为一名优秀的Web开发人员的部分原因。 我对那些使网站使用困难的事情感到恼火,这些事情应该是基本的。 以下列出了五个常见的可用性错误以及避免这些错误的解决方案。 请您和您的用户帮个忙,并确保您没有违反任何这些规则。

使用submit而不是click事件; 使用<Form>标签! (Use submit Instead of click Events; Use <Form> Tags!)

I can't tell you the number of times I've tried to submit a (perceived) form with the ENTER key (or mobile arrow/enter key) and watched absolutely nothing happen.  I then click or tap the submit button and the form finally does something.  This is my single biggest usability peeve and a sure sign of amateur hour.  Tabbing to the submit button and closing the mobile keyboard and scrolling to the submit button are incredibly annoying extra steps that don't need to exist.  Simply use submit like you should and we'll be friends again:

我无法告诉您我尝试使用ENTER键(或移动箭头/输入键)提交(感知)表单的次数,但看着没有任何React。 然后,我单击或点击“提交”按钮,表单最终完成了一些操作。 这是我最大的可用性烦恼,也是业余时间的肯定信号。 切换到“提交”按钮,关闭移动键盘并滚动到“提交”按钮是令人讨厌的不必要的多余步骤。 只需像您应该使用的那样使用submit ,我们将再次成为朋友:


document.getElementById("myForm").addEventListener("submit", function(e) {
	e.preventDefault();
	
	// ... Do processing here.  Yay for "enter" key submission!

	return false;
});


If you're committing this atrocity anywhere, please fix it immediately.  Sincerely, every kitten that's died due to your sins.

如果您在任何地方犯下这种暴行,请立即解决。 真诚地,每只因您的罪过而死的小猫。

单击事件:不要同时按下[CONTROL]或[META] (Click Events:  Don't Prevent When [CONTROL] or [META] is also pressed)

I'm a serial new-tab-opener and while I've been recently looking for a new house, I've been looking at listing websites.  I'll get to a list page and command-click a few houses I'd like to view photos of, only to get redirected to a page in the same tab;  victim of a click listener and a window.location change.  Horrible.  Before you preventDefault on any link, be sure to check for meta and control properties:

我是一个连续的新标签发布者,虽然我最近一直在寻找新房子,但我一直在寻找上市网站。 我将进入列表页面,然后用命令单击一些要查看其照片的房屋,然后将其重定向到同一标签中的页面; 单击侦听器和window.location更改的受害者。 可怕。 在任何链接上阻止default之前,请确保检查meta和控件属性:


document.getElementById("myLink").addEventListener("click", function(e) {
	// e.preventDefault();  (bad)

	if(e.meta || e.ctrlKey) return; // Don't block user if they want to open a new tab
	e.preventDefault();
});


I currently make this check on this blog so that users can open new tabs without issue.  Don't make your users play the click-back-click-back game on your site!

我目前在此Blog上进行了检查,以便用户可以打开新选项卡而不会出现问题。 不要让您的用户在您的网站上玩点击-点击-点击-返回游戏!

将标题属性添加到具有文本溢出的元素:省略号 (Add Title Attributes To Elements with text-overflow: ellipsis)

The (somewhat) new CSS text-overflow: ellipsis property and value are awesome.  Developers used to go through hell trying to duplicate this effect.  I'm all for using text-overflow: ellipsis, but if I hover over an element that utilizes this, you better throw a title attribute on it so I can quickly see the entire text:

(有点)新CSS text-overflow: ellipsis属性和值很棒。 开发人员曾经经历过地狱,试图复制这种效果。 我全都使用text-overflow: ellipsis ,但是如果将鼠标悬停在使用此元素的元素上,则最好在其上放置title属性,以便快速查看整个文本:


<div class="ellipsizeMe" title="I am some really, really long text that's going to be ellipsized">
I am some really, really long text that's going to be ellipsized
</div>


If you don't want to output the content twice, you can use JS to set the title dynamically.  Whatever you do...please hook your users up.

如果您不想两次输出内容,则可以使用JS动态设置标题。 无论您做什么...都请吸引您的用户。

不要忘记:focus:active(Don't forget :focus and :active!)

Too many people forget these states when styling elements, assuming the user has a mouse -- bad form.  Use the :focus and :active states too:

假设用户的鼠标形状不好,太多的人会在设置元素样式时忘记这些状态。 也使用:focus:active状态:


a:hover, a:active, a:focus { /* change _all_ the pseudos! */
	color: #900;
}


Do yourself a favor:  next time you create a site, tab all the way through the page;  if you hit tab and have no idea what got focus, check out your stylesheet and see if you forgot to add one of these states!

帮自己一个忙:下次创建网站时,请在整个页面中逐个标签; 如果您按了Tab键,却不知道焦点是什么,请查看样式表,看看是否忘记添加以下状态之一!

使用输入类型搜索/电子邮件 (Use Input type search / email)

When I'm trying to complete the hell that is a form on a mobile device, I get incredibly frustrated when I have to swap between keyboard screens to get to a "@".  Be a grownup and use the correct input type:

当我试图完成移动设备上的表单这一幕时,当我不得不在键盘屏幕之间切换以获取“ @”时,我感到非常沮丧。 长大成人并使用正确的输入类型:


<input type="search" value="" />

<input type="email" value="" />


One quick update, huge usability boost for your mobile users.

快速更新,为您的移动用户带来巨大的可用性。

There are hundreds of common usability mistakes a developer can make, so expect more of these posts in the future.  The promising thing is that most usability issues are very simple to correct, as you probably noticed above.  Let me know if you have usability faux pas and solutions you'd like to make people aware of, and I'll compile another post sharing them!

开发人员可能会犯数百种常见的可用性错误,因此将来会期望更多此类错误。 很有希望的是,正如您在上面可能注意到的那样,大多数可用性问题都非常容易纠正。 让我知道您是否希望使人们知道可用性的实用性和解决方案,我将在另一篇文章中与他人分享!

翻译自: https://davidwalsh.name/common-usability-mistakes

正在连接可用性组 错误

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: JDBC(Java数据库连接)是Java程序与数据库之间进行交互的重要工具。JDBC 8.0.11是JDBC的一个版本,但在使用过程中,可能会遇到一些常见错误。以下是几常见错误: 1. ClassNotFoundException(类未找到异常):这通常是由于未找到JDBC驱动程序引起的。在使用JDBC时,需要确保正确配置了驱动程序的类路径,并且驱动程序的jar文件已经导入到项目中。 2. SQLException(SQL异常):这是由于SQL语句执行或连接数据库过程中出现的问题。常见的原因有:错误的SQL语法、连接数据库时的用户名或密码错误、数据库服务器关闭等。在遇到SQLException时,我们需要仔细检查SQL语句的正确性,并确保数据库连接参数的正确性。 3. ConnectException(连接异常):这是由于无法连接到数据库服务器引起的。可能的原因包括:数据库服务器地址或端口号配置错误、网络连接故障、数据库服务器未启动等。在遇到连接异常时,我们需要确保数据库服务器处于正常运行状态,并检查连接参数的准确性。 4. DataConversionException(数据转换异常):这是由于数据类型转换错误引起的。在使用JDBC时,Java和数据库之间的数据类型需要正确匹配。在进行数据操作时,需要确保正确的数据类型转换,以避免此类异常。 5. BatchUpdateException(批处理异常):这是由于批处理操作中某一项失败,导致整个批处理操作失败引起的。在进行批处理操作时,需要逐一检查每一条SQL语句的执行结果,并处理其中的异常情况。 总之,JDBC 8.0.11在使用过程中可能会遇到上述常见错误,我们需要仔细检查代码、确保配置正确、处理异常情况,以保证程序与数据库的正常交互。 ### 回答2: JDBC 8.0.11是Java数据库连接(JDBC)的一个版本,用于在Java程序和数据库之间进行通信。在使用这个版本时,可能会遇到一些常见错误。下面是一些可能会出现的错误和解决方法: 1. ClassNotFoundException:这个错误通常发生在Java程序无法找到JDBC驱动程序时。解决方法是确保已经将JDBC驱动程序的jar文件添加到项目的类路径中。 2. SQLException:这是一个在与数据库交互时常见错误。这个错误可能会发生在连接数据库、执行查询或更新语句时。解决方法是检查数据库连接URL、用户名和密码是否正确,并确保数据库服务器运行正常。 3. NullPointerException:这个错误通常表示代码中的空指针引用。在使用JDBC时,可能会发生这个错误,比如在尝试使用已关闭的连接或未初始化的变量时。解决方法是仔细检查代码并确保所有的对象都被正确地初始化和关闭。 4. BatchUpdateException:在批量执行更新操作时可能会出现这个异常。这个异常表示在执行一批更新语句时,其中一个或多个语句执行失败。解决方法是检查每个更新语句的语法和逻辑,并确保它们正确地执行。 5. DataTruncation:这个异常通常发生在尝试将数据插入到字段中,而字段长度不足以容纳该数据。解决方法是检查数据库表结构的设计,并确保字段长度足够容纳所需的数据。 这些是一些JDBC 8.0.11常见错误和解决方法。当使用JDBC时,遇到错误是很常见的,但通过仔细检查和调试代码,可以很容易地解决这些问题,并确保与数据库的正常通信。 ### 回答3: JDBC 8.0.11是Java连接数据库的一个版本,虽然它相对较新,但仍然有一些常见错误可能发生。以下是几个常见错误以及可能的解决方案: 1. ClassNotFoundException:这个错误意味着无法找到指定的JDBC驱动程序。解决方法是检查你的类路径中是否包含正确的驱动程序JAR文件,并确保在连接数据库之前加载驱动程序。 2. SQLException:这个错误通常表示在执行SQL查询或更新时出现问题。可能的原因包括SQL语句的语法错误、无效的表或列名称以及数据库连接问题。为了解决这个问题,首先检查你的SQL语句的正确性,并确保数据库连接可用性。 3. ConnectionTimeoutException:这个错误意味着连接数据库的超时时间已过。这可能是由于网络问题、数据库服务器负载过高或数据库连接池配置不正确等原因引起的。要解决这个问题,可以尝试增加连接超时时间,并确保数据库服务器的正常运行。 4. IntegrityConstraintViolationException:这个错误意味着在数据库表中违反了完整性约束,例如主键或唯一键冲突。解决这个问题的方法是检查数据插入或更新的值是否满足表中的约束条件,并确保只插入或更新有效的数据。 5. ResultSetClosedException:这个错误意味着试图访问一个已经关闭的结果集。解决这个问题的方法是确保在使用结果集之前,通过调用关闭方法来正确地关闭结果集。 总之,理解和解决这些常见错误能够帮助开发人员更好地使用JDBC 8.0.11连接数据库,并减少潜在的错误和问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值