Window Browser JavaScript DHTML



Detecting Browser Capabilities

function displayNavigatorProperties() {
 with(document) {
  write("appName: ")
  writeln(navigator.appName+"
")
  write("appVersion: ")
  writeln(navigator.appVersion+"
")
  write("appCodeName: ")
  writeln(navigator.appCodeName+"
")
  write("platform: ")
  writeln(navigator.platform+"
")
  write("userAgent: ")
  writeln(navigator.userAgent+"
")
  write("language: ")
  writeln(navigator.language+"
")
  write("Number of mimeTypes: ")
  writeln(navigator.mimeTypes.length+"
")
  write("Number of plugins: ")
  writeln(navigator.plugins.length)
 }
}
function displayExplorerProperties() {
 with(document) {
  write("appName: ")
  writeln(navigator.appName+"
")
  write("appVersion: ")
  writeln(navigator.appVersion+"
")
  write("appMinorVersion: ")
  writeln(navigator.appMinorVersion+"
")
  write("appCodeName: ")
  writeln(navigator.appCodeName+"
")
  write("platform: ")
  writeln(navigator.platform+"
")
  write("cpuClass: ")
  writeln(navigator.cpuClass+"
")
  write("userAgent: ")
  writeln(navigator.userAgent+"
")
  write("cookieEnabled: ")
  writeln(navigator.cookieEnabled+"
")
  write("browserLanguage: ")
  writeln(navigator.browserLanguage+"
")
  write("userLanguage: ")
  writeln(navigator.userLanguage+"
")
  write("systemLanguage: ")
  writeln(navigator.systemLanguage+"
")
  write("onLine: ")
  writeln(navigator.onLine+"
")
  write("Number of mimeTypes: ")
  writeln(navigator.mimeTypes.length+"
")
  write("Number of plugins: ")
  writeln(navigator.plugins.length+"
")
  write("userProfile: ")
  writeln(navigator.userProfile)
 }
}
function displayBrowserProperties() {
 if(navigator.appName=="Netscape")
  displayNavigatorProperties()
 else
  if(navigator.appName=="Microsoft Internet Explorer")
   displayExplorerProperties()
}
displayBrowserProperties()