You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

3 years ago
  1. function checkJre(){
  2. var agt=navigator.userAgent.toLowerCase();
  3. var is_major = parseInt(navigator.appVersion);
  4. var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')== -1)
  5. && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')== -1)
  6. && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')== -1));
  7. var is_nav4up = (is_nav && (is_major >= 4));
  8. var pluginDetected = false;
  9. // we can check for plugin existence only when browser is 'is_ie5up' or 'is_nav4up'
  10. if(is_nav4up) {
  11. // Refresh 'navigator.plugins' to get newly installed plugins.
  12. // Use 'navigator.plugins.refresh(false)' to refresh plugins
  13. // without refreshing open documents (browser windows)
  14. if(navigator.plugins) {
  15. navigator.plugins.refresh(false);
  16. }
  17. // check for Java plugin in installed plugins
  18. if(navigator.mimeTypes) {
  19. // window.alert( navigator.mimeTypes.length);
  20. for (i=0; i < navigator.mimeTypes.length; i++) {
  21. // window.alert( navigator.mimeTypes[i].type);
  22. if( (navigator.mimeTypes[ i].type != null)
  23. &&(navigator.mimeTypes[ i].type.indexOf(
  24. "application/x-java-applet;jpi-version=1.4") != -1) ) {
  25. //window.alert("Found");
  26. pluginDetected = true;
  27. break;
  28. }
  29. }
  30. }
  31. }
  32. if (pluginDetected) {
  33. // show applet page
  34. document.location.href="appletref.htm";
  35. } else if (confirm("Java Plugin 1.4+ not found, Do you want to download it?\n" +
  36. "if you choose not to install the plugin the reports graphical applets will not be available.")) {
  37. document.location.href=XilinxD;
  38. } else {
  39. document.location.href="appletref.htm";
  40. }
  41. }