window.navigator or just navigator?

Either, it doesn't really matter. navigator is a property of the window object, but all properties of the window object are accessible as global variables.

navigator === window.navigator;
//-> true

As a personal preference, I always write window.propertyName for explicit properties of the window object.


you can use this ....

 alert("You're using " + navigator.appName);

for reference pls go through this link navigator