Create No-JavaScript friendly sites

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

内容简介: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 .


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

查看所有标签

猜你喜欢:

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

软件研发之道

软件研发之道

Jim McCarthy、Michele McCarthy / 赵 俐、石华耀 / 人民邮电出版社 / 2011-8 / 45.00元

Jim McCarlthy等的《软件研发之道 微软开发团队的经验法则》叙述 了微软Visual C++开发团队的故事,通过作者的总结和归纳告诉读者如何 构建一个优秀的软件开发团队,如何在一段时间内成功地交付一个软件。 作为升级版,作者将言简意赅的法则扩展到57条,包括了软件研发及营销 的全部内容,相信每一位项目经理都会对此书爱不释手。 《软件研发之道 微软开......一起来看看 《软件研发之道》 这本书的介绍吧!

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

在线图片转Base64编码工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具