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 .


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

查看所有标签

猜你喜欢:

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

Distributed Algorithms

Distributed Algorithms

Wan Fokkink / The MIT Press / 2013-12-6 / USD 40.00

This book offers students and researchers a guide to distributed algorithms that emphasizes examples and exercises rather than the intricacies of mathematical models. It avoids mathematical argumentat......一起来看看 《Distributed Algorithms》 这本书的介绍吧!

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

RGB HEX 互转工具

随机密码生成器
随机密码生成器

多种字符组合密码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码