Javascript已停用最佳做法? [英] Javascript disabled best practices?

查看:169
本文介绍了Javascript已停用最佳做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人优化他们的网页有一些友好的行为,如果用户已禁用Javascript。在这样的实例中有没有提供一些伪脚本行为的技巧?我说的基本的东西,如在新窗口中打开链接。我想象还有很多,你可以做没有Javascript。在某些情况下,它可以方便地有一个页面,它有一些功能,它可以回来。有什么做法吗?

I would like to know if anyone optimizes their web pages to have some friendly behavior if the user has Javascript disabled. Are there any tricks to provide some pseudo-scripting behavior in such instances? I'm talking basic things like opening links in new windows. I would imagine there is still a lot you can do without Javascript. It could be handy in some cases to have a page that has some features it can fall back on. Are there any practices?

编辑:好的答案到目前为止!人们会介意包括一些示例代码(来,HTML是sooo容易!),因为我不认为我已经看到这样的问题在SO仍然。

good answers so far! Would people mind including some sample code (come on, HTML is sooo easy!) since I don't think I've seen a question like this on SO yet.

推荐答案

我有时做的是设置要求Javascript不显示的功能,然后使用Javascript来使它们显示。这样的人没有Javascript看不到他们不能使用的功能。然后在< noscript> 标签中加入替代功能。

What I sometimes do is set the features that require Javascript to not display, then use Javascript to make them display. That way people with out Javascript wont see features they can't use. And then put alternative features in <noscript> tags.

这篇关于Javascript已停用最佳做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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