shell 错误停止_停止上网错误。

shell 错误停止

shell 错误停止

Some days...some days it's frustrating to be on the web. We're compiling C++ into JavaScript and running Unreal in the browser but at the same time, here in 2013, we're still making the same mistakes. And by we, I mean, the set of web developers who aren't us, right Dear Reader? Because surely you're not doing any of these things. ;)

有些日子...有些日子上网令人沮丧。 我们正在将C ++编译为JavaScript并在浏览器中运行Unreal,但与此同时,在2013年,我们仍然犯同样的错误。 我的意思是,不是我们的一组Web开发人员,对吧,亲爱的读者? 因为您肯定没有做任何这些事情。 ;)

All of these are solvable problems. They aren't technically hard, or even technically interesting. I consider these "will-required" problems. You need the knowledge that it's wrong and the will to fix it. As users - and web developers - we need to complain to the right people and help fix it.

所有这些都是可解决的问题。 它们在技术上并不难,甚至在技术上也不有趣。 我考虑了这些“将需要的”问题。 您需要知道它是错误的,并且有解决它的意愿。 作为用户-和Web开发人员-我们需要向合适的人投诉并进行修复。

将深层桌面链接重定向到移动主页 (Redirecting a deep desktop link to a mobile home page)

Google has decided that the practice of taking perfectly good deep links like foo.com/something/deep, detecting a mobile device, then redirecting to m.foo.com is user-hostile. In fact, the GoogleBot is going to declare these "faulty redirects" and ding sites in the search result ranking. Stated simply:

Google决定,采取完全良好的深层链接(例如foo.com/something/deep),检测移动设备然后重定向到m.foo.com的做法是对用户不利的。 实际上,GoogleBot将在搜索结果排名中声明这些“错误的重定向”并确定站点。 简单地说

Avoiding irrelevant redirects is very easy: Simply redirect smartphone users from a desktop page to its equivalent smartphone-optimized page. If the content doesn't exist in a smartphone-friendly format, showing the desktop content is better than redirecting to an irrelevant page.

避免不相关的重定向非常容易:只需将智能手机用户从桌面页面重定向到等效的智能手机优化页面。 如果内容不以适合智能手机使用的格式存在,则显示桌面内容要比重定向到不相关的页面更好。

For example, if I want to go to the http://www.mcmenamins.com/Pubs page, but I do it on mobile, they ALWAYS redirect me to /mobile. Always. Even though I have a quad-processor pocket supercomputer with gigs of space I've still surfing a second-class internet.

例如,如果我想转到http://www.mcmenamins.com/Pubs页面,但是我在移动设备上进行操作,他们总是将我重定向到/ mobile。 总是。 即使我有一台具有四核处理器的袖珍超级计算机,但它们的存储空间却很少,但我仍在浏览二级互联网。

 

我不要你的烂应用 (I don't want your crappy app)

That means you Quora. I am in my browser, unless I'm going to the App Store, let's assume if I'm in the browser, I want to be on the web.

这意味着您Quora。 我在我的浏览器中,除非我要去App Store,否则假设我在浏览器中,我想上网。

巨型非页内广告 (Giant Interstitial Ads)

I'm looking at you, Forbes.com. I GET IT. YOU HAVE ADS.

我在看着你,Forbes.com。 我知道了。 您有广告。

Interstitial Ads are Evil

Stay classy.

保持优雅。

输入表格的标签 (Labels for Input Forms)

I hate seeing a checkbox and only being able to click on that exact checkbox.

我讨厌看到一个复选框,只能单击该确切的复选框。

<p>Which fruit would you like for lunch?</p>
<form>
<input type="radio" name="fruit" id="banana" />
<label for="banana">Banana</label>
<input type="radio" name="fruit" id="None" />
<label for="none">None</label>
</form>

It's so easy to just associate a label with an input. Please do  it, then we can all have something larger to click on.

只需将标签与输入关联即可。 请这样做,然后我们都可以单击一些较大的内容。

断开超链接 (Breaking Hyperlinks)

We're still doing this. Haven't we learned that Cool URIs Don't Change? It was true in 1998 when that was written and it's true now. The web as we know it was created in 1990 and made truly open in 1993 and the link to the First Web Page (yes, Capital Letters) is still http://info.cern.ch/hypertext/WWW/TheProject.html. I love that they've done the work to keep that link alive.

我们仍在这样做。 我们难道不知道酷URI不会改变吗? 1998年写的时候是真的,现在也是如此。 我们知道的该网站创建于1990年,并于1993年真正开放,并且到第一个网页的链接(是,大写字母)仍然是http://info.cern.ch/hypertext/WWW/TheProject.html 。 我喜欢他们为保持链接的有效性所做的工作。

There's just no excuse for this. With .htaccess files and web.config files, maintain a list of redirects and do your best to test them. Maintaining deep and complex links can be complex, but if you're companyname.com/about link dies because you switch from PHP to Rails, there's just no excuse for that. I'm your User and I have always typed /about. Don't' give me a To Do like "Update your bookmarks!" I didn't come here for a To-Do, I came her for your damn about page. YOU figure it out.

对此没有任何借口。 使用.htaccess文件和web.config文件,维护重定向列表,并尽力对其进行测试。 维护深层和复杂的链接可能很复杂,但是如果您是companyname.com/about链接模具,因为您是从PHP切换到Rails的,那么这没有任何借口。 我是您的用户,并且总是输入/ about。 不要给我一个待办事项,例如“更新您的书签!” 我不是来这里做工作的,我来是因为你该死的关于页面的事情。 您知道了。

单击代表您的语言的标志 (Click the Flag that represents your Language)

I've often been asked to "select my language" from a list of country flags, and ended up clicking on the Union Jack to represent "English." I'm sure the actual English don't appreciate an American declaring they speak English. ;)

经常有人要求我从国旗列表中“选择我的语言”,然后最后单击“英国国旗”代表“英语”。 我敢肯定,实际的英语不会感激美国人说他们会说英语。 ;)

Nothing says pick a language like all the United Nations Flags

but I know I'm not the only one who realizes that a Flag is a lousy representation of a language, especially since your browser is announcing what languages you speak with every web request.

但我知道我并不是唯一一个意识到Flag是一种语言的糟糕代表的人,尤其是因为您的浏览器会在每个Web请求中宣布您使用的语言

Accept:text/html
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8

There can be a whole list of languages in the Accept-Language header, in the order the user prefers them!  Use that data, it's there for you to use.

在Accept-Language标头中可以有一个完整的语言列表,按用户喜欢的顺序排列! 使用这些数据,就可以使用。

您知道我的邮政编码,为什么我要进入我的州? (You know my Zip Code, why am I entering my State?)

For folks living in the states, we're always asked to enter our postal code (ZIP code) and our city and state, even though there are dozens of great APIs and Databases that can give you that information.

对于居住在各州的人们,尽管有数十种出色的API和数据库可以为您提供相关信息,但始终会要求我们输入邮政编码(邮政编码)以及城市和州。

Don't make me enter my state

The meta-point is this: If you can reliably determine something from the user (language, location, country, preference) without invading their privacy, do it! Save them a little time!

重点是:如果您可以可靠地确定用户的某些信息(语言,位置,国家/地区,偏好),而又不会侵犯其隐私,那就去做吧! 节省他们一点时间!

使用width和height属性调整巨型图像的大小 (Resizing Giant Images with width and height attributes)

Perhaps take a moment and remind your boss that the 6 megapixel photo that he or she took with their new Canon EOS is not a good background image for your corporate site...especially if it's a 4 megabyte JPGs.

也许花点时间提醒您的老板,他或她使用新的佳能EOS拍摄的6兆像素照片对于您的公司网站来说不是一个很好的背景图片……尤其是4兆JPG的图片。

Oh, that's OK, we can just <img src="bigassfile.jpg" width="100" height="100"> and that will make it smaller. No, that just downloads the giant file and then makes your browser do the work to resize it on the client.

哦,没关系,我们可以<img src =“ bigassfile.jpg” width =“ 100” height =“ 100”>来缩小它。 不,那只是下载巨型文件,然后使您的浏览器完成在客户端上调整其大小的工作。

Resize first, and squish often. Also run all your PNGs through PNGGauntlet or PNGOut.

首先调整大小,并经常挤压。 还可以通过PNGGauntletPNGOut运行所有PNG。

从两个网站提供网页。 和裸域 (Serving pages from both www. and naked domains)

If you've got example.com/something AND www.example.com/something both serving up the same content, consider "canonicalizing" your URLs. You can do this with rel="canonical" in your META tags, but that only hides the problems and makes the Googlebot happy. Instead, why not PICK ONE and serve a 301 redirect to the other? Did you know that there are rules built into IIS7 that will set this up for you? You can even remove your .aspx extension if that makes you happy. You can do it!

如果您的example.com/something和www.example.com/something都提供相同的内容,请考虑“规范化”您的URL。 您可以在META标记中使用rel =“ canonical”来执行此操作,但这只会掩盖问题并使Googlebot满意。 相反,为什么不选择一个并提供301重定向到另一个呢? 您是否知道IIS7中内置了一些规则可以为您设置? 如果您感到满意,甚至可以删除.aspx扩展名。 你能行的!

image

The same is true if you do the same thing for / and /default.html. Pick one if you can, and redirect the other.

如果对/和/default.html执行相同的操作,则同样如此。 如果可以,请选择一个,然后重定向另一个。

<system.webServer>
<rewrite>
<rules>
<rule name="CanonicalHostNameRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" matchType="Pattern" pattern="^hanselman\.com$" ignoreCase="true" negate="false" />
</conditions>
<action type="Redirect" url="http://www.hanselman.com/{R:1}" redirectType="Found" />
</rule>
<match url="blog/default.aspx" />
<action type="Redirect" url="blog/" redirectType="Found" />
</rule>
<rules>
<rewrite>
<system.webServer>

其他?(Others?)

What are some great examples that you think Break The Internet...but that are easily fixed if we have the will?

您认为有哪些很棒的例子可以打破互联网……但只要我们有意愿,这些例子就很容易解决?

翻译自: https://www.hanselman.com/blog/stop-doing-internet-wrong

shell 错误停止

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值