开发者

Javascript disabled, short questions

Just some short Q regarding javascript and websites.

1- By javascript enabled, does it mean to have 'sun java' installed and enabled in the browser settings? Or does every browser have javascript enabled always?

2- If javascript is disabled, my website for example wouldn't work at all, so what does major developers do in these situations, if the only way to achieve their goal is to use javascript?

3- Is ajax also disabl开发者_如何转开发ed if javascript is disabled? Also, same for Jquery because its a javascript library ?

Thanks guys


  1. Sun's Java is not the same thing as JavaScript. Java is an extension to the browser which user might or not have installed. JavaScript comes with browser and can be disabled by the user.

  2. Display a notice to the user that he/she should turn JavaScript on.

  3. Ajax and jQuery are Javascript, so yes, they're disabled also.


Question 1: Java and JavaScript are two different languages. JavaScript is a dynamically typed language where Java is strictly typed language (i.e. you have to define variables as int, string, etc...). Every browser except for screen readers should have JavaScript turned on by default. The thing to remember is that users have the ability to turn off JavaScript if they so choose. The reason they turn it off is because during the 90s JavaScript was used in the wrong ways such as creating pop-up after pop-up windows and other mischievous things.

Question 2: You should always develop your website to work without JavaScript turned on. JavaScript is like icing on the cake. It is the fancy behavior that your website has. The technique of developing your website to work with JavaScript turned off but be more "enhanced" when it is turned on is called "Unobtrusive JavaScript". Basically, it means that your users can get to your web pages content without the need of JavaScript. Search in Google for "Unobtrusive JavaScript" and you will find a plethora of information and techniques.

Here are just a couple links to get you started: A List Apart Behavioral Separation Easy as Pie - Unobtrusive JavaScript

Question 3: Yes. If JavaScript is turned off then your Ajax methods and jQuery library will not work.

Do some research regarding this topic. You will find a lot of information that will help you in your journey of discovering Unobtrusive JavaScript.


  1. Users can enable or disable javascript in their browser settings. It isn't a matter of what is installed in the browser, but rather the user's preferences.

  2. When you can't use javascript, you generally can accomplish the same thing by doing more postbacks. The user experience will definitely be slower.

  3. Ajax and jQuery rely on javascript being enabled by the user.


  1. No. Javascript and Java are two different thing
  2. Which is why your developers must consider the case where Javascript is disabled. Your site should run gracefully ( albelt with reduce functionality) even if Javascript is not enabled ( such as when on mobile). This means that your should have a basic version of the site for the user without Javascript to browse.
  3. Yes.


  1. All modern browsers come with a built-in JavaScript engine but the user can disable it. JavaScript has a similar syntax as Java (from Sun) but it's a language of its own.

  2. If your website needs JS, then add an HTML element which says "Please enable JavaScript" and make it invisible in one of your scripts. When the users can see it, then she has JS disabled.

  3. AJAX doesn't work when JS is disabled. The same is true for jQuery.


1 - No, javascript is read through web browsers, and is by default on most of the time. A user would normally need to disable it themselves.

2 - There is a development practice called Graceful Degredation which may help you to create websites that will still work if javascript is disabled.

3 - Ajax is much more difficult without javascript, but again Graceful Degredation may help you here.


  1. No. 'sun java' and JavaScript are two different things. JavaScript is present and enabled by default in all modern browsers.
  2. You can place message asking user to enable JavaScript in his browser inside <noscript></noscript> tag.
  3. Yes AJAX and jQuery require JavaScript to be enabled.


Graceful degredation for point 2 is definitely the way to go - jQuery is big on this. Your page contains the markup required for your site to function via postbacks.

This can then be 'hijaxed' by your script to enable AJAX updates etc. This means that if a user is prepared to enable a nicer experience they can.

If you are programming internal intranet sites, you can usually assume that scripting would be enabled - these sites are often very script intensive...


1- Every browse live alone... and so doesnt matter if java is installed for command javascript.

3- AJAX core is javascript. If javascript is disabled, ajax is disabled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜