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 .


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

查看所有标签

猜你喜欢:

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

Squid: The Definitive Guide

Squid: The Definitive Guide

Duane Wessels / O'Reilly Media / 2004 / $44.95 US, $65.95 CA, £31.95 UK

Squid is the most popular Web caching software in use today, and it works on a variety of platforms including Linux, FreeBSD, and Windows. Squid improves network performance by reducing the amount of......一起来看看 《Squid: The Definitive Guide》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

MD5 加密
MD5 加密

MD5 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器