Quantcast
Channel: eInfoBuzz » JavaScript
Viewing all articles
Browse latest Browse all 2

Detecting Java is enabled inside Browser

$
0
0

You can easily get multiple aspects of your client browser through Javascript window navigator Object.

Methods like

javaEnabled(): javaEnabled method of Javascript navigator object detects that the browser has Java Enabled or not. javaEnabled method returns true or false based on the client browser settings.
alert("Is Java working: "+ window.navigator.javaEnabled());
Navigator Object Collections:

plugins: plugins collections returns the Plugins supported by the client browser that can be embedded in the HTML pages using HTML object tag or embed tag e.g.: media player plug-in, real player plug-in, flash player or shockwave plug-in.

mimeTypes: mimeTypes collection of Javascript navigator object returns the collection of mimeTypes supported by client browser. E.g.: application/pdf, application/x-shockwave-flash etc.

Javascript window navigator object provides the functionality to detect the number of aspects of browser.

Javascript navigator object can be used with or without window object e.g.: window.navigator or directly navigator.

When we use window.navigator it represents the browser window and its navigator object. If we use navigator object directly it automatically detects the browser window object that is created dynamically by Javascript runtime engine and collects the information about client browser.

Javascript navigator object enables you to detect the browser settings also. Javascript navigator object can detect whether cookies are enabled or not. Navigator object can also detect the browser has javascript enabled or not. You can also detect the browser using navigator object.


Javascript code can detect the name and version of browsers. Javascript browser detection can be done by using methods, functions or properties of Javascript object navigator. Why Javascript browser detection is necessary these days? Yes its necessary coz there are number of internet users these days browsing websites. Every user is using different browser for surfing web sites according their ease of use. There are number features of websites that work on different browsers normally whereas shows erroneous response in others that depends on the version and name of the browsers. So, it becomes important for the designers as well as developers to detect the browser and perform the actions conditionally.

JavaScript navigator object:

navigator.appName
returns the name of browser e.g.: Microsoft Internet Explorer, Netscape, Opera etc.

navigator.appVersion
returns the version of browser and the platform i.e. Operating system platform and other CLR installed on the client side.

navigator.appCodeName
returns the code name of browser, e.g.: Mozilla for all browsers instaled on Microsoft Windows platform.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images