Comparison | Javascript | Java | ||
---|---|---|---|---|
Type | Scripting language for browsers | complete programming language | ||
requirements | modern browser (Javascript enabled) | Software Java Virtual Machine
+ plugin for browser (for use online) |
||
Use | Evaluation of mouse movement, form control, interaction with users,
use of cookies, changing website content and adapting appearance
Almost all providers use Javascript to improve their offer, since it runs directly in the user's browser. Javascript makes it possible for HTML pages to interact without having to request or change the entire page with new content.
This animated Fakoo clock shows the time with 6 Fakoo digits: S S : M M : s s |
Games, puzzles, chats, calculators, picture galleries, puzzles
and many other applications can be integrated into websites.
However, the strength of Java lies outside of the Internet in platform-independent computer applications. The biggest use of Java today is in programming apps for Android phones. In addition to Java, website applications were also offered in Flash. Flash was safer and easier to use, but had the disadvantage that the entire application had to be loaded first. Flash was discontinued in 2020. |
||
transmission | within HTML files or as separate JS file | as applets in separate CLASS files | ||
Call in HTML | <script>... </script> |
<applet>... </applet> |
||
Code | Script statements (readable) | Applets are precompiled (unreadable) | ||
Security | Javascript has access only to browser objects, special actions require explicit permission of user (browser settings)
Unfortunately, Javascript can only be activated or deactivated in Internet Explorer together with VBScript. And VBScript is a programming language that also has write and read access to files on the computer. Therefore, VBScript is a security risk. |
Applets are complete program codes that are executed on the user's
computer. The browser plugin provides a separate runtime environment (sandbox). A security risk
from "malicious" applets only exists if the sandbox is faulty (bytecode control).
(Tip: Only load applets from signed sources) |
||
Notes to programmers | Websites must also remain functional without Javascript. For technical
reasons it is often not possible for the user to use Javascript.
„Bad style“ includes:
|
Check if the user can use Java by placing a Java-based link to Java offerings.
Java is off
in your browser!
|
||
AJAX |
AJAX connects JavaScript in the browser with server functions.
This enables functions in a page that would normally require a page refresh - for example, searching a database while typing in a form (every keystroke is sent to the server). AJAX-Functions cannot be made barrier-free because the content of a page changes dynamically. The saving of favorites (linking of the content) and the navigation in the browser are also limited. No AJAX is used on fakoo.de, all data are already contained in Javascript files or are available as HTML files or text and can be linked directly. |
Only install Java VM (Java Virtual Machine) if you
Javascript , on the other hand, can be switched on safely if