Create No-JavaScript friendly sites

栏目: IT技术 · 发布时间: 5年前

内容简介:The other day one of the post of my other site was posted on reddit, and one of the readers commented that my site was unusable withAnyway, that event made me think that my site's menu just do not work if one deactivates the JavaScript support on the brows

Create No-JavaScript friendly sites

Introduction

The other day one of the post of my other site was posted on reddit, and one of the readers commented that my site was unusable with No Script . Well the whole problem was that I've got the wrong configuration of PageSpeed Module , and the site entered in an infinite loop.

Anyway, that event made me think that my site's menu just do not work if one deactivates the JavaScript support on the browser.

That site is based on Foundation , therefore it depends heavily on JavaScript, and on JQuery library.

Be a good digital citizen

Because most trackers use JavaScript to track you, a lot of people block JavaScript on their browsers using different software in order to do that.

If you want everybody to be able to read your website, and use your navigation, you should not make it in such a way that it will depend on JavaScript to work

Big examples

Most sites will depend on JavaScript to display the hamburger menu when you visit the site using a small screen, that is my case on my other website, but some will not even work on big screens for example.

On both of them you can't use the menu if the No Script extension is on your web browser, even if you are working on big screens.

Options to avoid the use of JavaScript

There are different approaches to use if you want to avoid the use of JavaScript in your menus.

  1. Check for javascript and if not present, load an alternate menu
  2. Use a CSS menu:
    1. Option 1
    2. Option 2

Another option I like is to create a new page for your menu, if you are using WordPress, take a look at this theme , which uses the approach I have mentioned, a dedicated page for menu.

Conclusion

You create your website in order for people to visit it, you create menus in order to make navigation of your website easy. So you need to ensure that your site will be usable no matter the technology your visitor is using. There will always be parts of the website that might not work with JavaScript disabled, but the menu should work .


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

免费

免费

[美] 克里斯·安德森 / 蒋旭峰、冯斌、璩静 / 中信出版社 / 2009-9 / 39.00

在《免费:商业的未来 》这本书,克里斯·安德森认为,新型的“免费”并不是一种左口袋出、右口袋进的营销策略,而是一种把货物和服务的成本压低到零的新型卓越能力。在上世纪“免费”是一种强有力的推销手段,而在21世纪它已经成为一种全新的经济模式。 究竟什么是免费商业模式?根据克里斯·安德森的说法,这种新型的“免费”商业模式是一种建立在以电脑字节为基础上的经济学,而非过去建立在物理原子基础上的经济学。......一起来看看 《免费》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具