What's the point of the javascript navigator.javaEnabled function?

霸气de小男生 提交于 2019-12-24 18:46:31

问题


The navigator object has a javaEnabled function that indicates if the browser has javascript support. This seems to be a little odd:

  • If JS is indeed enabled the function will return true, well obviously.
  • If JS is disabled it will return <nothing> since it is never run, javaScript is disabled.

I must be missing something here, or is it really that useless this function?


回答1:


java!= javaScript

navigator.javaEnabled checks for the presence of Java, not JavaScript.

Reference

This must be a relic from the olden days when Java applets were going to be the future of the web...




回答2:


You missed the fact that it's javaEnabled not javascriptEnabled.

navigator.javaEnabled: Indicates whether the host browser is Java-enabled or not.

https://developer.mozilla.org/en/dom/window.navigator



来源:https://stackoverflow.com/questions/2897333/whats-the-point-of-the-javascript-navigator-javaenabled-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!