Without JavaScript, what will your webpage look like?

Source: Internet
Author: User

Many websites now use JavaScript, which makes interaction response more responsive and enhances the so-called "User Experience ". Although it is a very simple programming language, JavaScript is becoming more and more important due to the increasing number of Web applications. However, while enjoying JavaScript and derivative libraries, have you ever wondered what your current webpage looks like without JavaScript?

My blog uses some jQuery functions. Obviously, it is based on JavaScript. I turned off the browser's JavaScript Engine and opened my blog. Fortunately, there was no deformation-the advertisement could not be displayed, which was beyond my control.

The "article" menu cannot be displayed, Because I registered the hover event through jQuery to bring it up. The "Back to Top" button is also invalid, which of course has little impact.

Before or after applying JavaScript ?), We should think about how to use JavaScript intelligently so that no one can access your website because of it. This is the core concept behind non-callback JavaScript.

To better understand what JavaScript is not just and why we need it, let's take a look at the uncertainties that may arise in JavaScript programming:

◆ Because some Browsers Do not support JavaScript or their supported JavaScript versions are too old, these browsers may ignore your scripts completely;

◆ Even if a browser supports JavaScript, users may disable JavaScript for security reasons, the firewall of your company may also remove all <script> labels to prevent JavaScript from running;

◆ Even if a browser supports JavaScript, it may not understand some of the browser's proprietary features in the DOM specification. IE is often regarded as a helper in this regard ), this will make the browser unable to understand some of your scripts;

◆ Even if the script can be correctly interpreted, it may depend on very complex HTML, and/or on HTML that may be changed in unpredictable ways;

◆ Even if the JavaScript script runs in a perfect HTML, you cannot determine what type of input device your user will use. Many scripts take effect only when users use the mouse, but do not respond to those who use the keyboard. Many users with disabilities cannot use the mouse, and some prefer the keyboard );

◆ Even if your script avoids all the above risks and runs well, other programmers may not understand it.

If the key content on a webpage is controlled by JavaScript, some users cannot use your website normally or lose important information.

If some content is controlled by JavaScript, when JavaScript cannot work normally, I set the style through CSS to make it look normal.

Here is an example of jQuery sliding navigation bar: Demo1, Demo2). Demo1 is normal at first glance, but if JavaScript is disabled, all projects will be congested, because all list items are absolutely positioned, the height needs to be dynamically determined by the JavaScript runtime; only a simple correction is made in Demo2 so that it remains relatively positioned before the JavaScript runtime, so that it can behave normally without JavaScript.

This example is simple, but sometimes it is assumed that JavaScript will always work for convenience. It should be avoided if possible to involve JavaScript in the formatting of important elements.

Link: http://beamnote.com/2010/without-javascript.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.