End of script : </script>.
- interpretation depends on browser type and version
- the source code is visible, so there is zero confidentiality
- the language is simple and so are its applications
- improving navigation options
- validating forms
- monitoring and routing according to the user's configuration
Use on EUROPA websites
- Use JS only if it adds real value to your site, not just for eye-catching effects.
- The content and main functionality of a website must not depend on scripting. If any functionality is implemented using script, provide an alternative.
- Put scripts code in a separate file and reference it from the
<head>section of each page.
- Avoid interfering with normal browser behaviour. Scripting should not be used to mimic browser behaviour or to or override normal browser functionality (like "Back").
- When using event handlers, use only those that are device independent (e.g., do not require the use of the mouse only).
- Web pages that utilize scripting must be fully navigable using a keyboard.
- Do not generate content on the fly. Normally, it is not detected by screen readers and other assistive technology, and can confuse users by interrupting linear navigation.
- Do not open new windows or jump to a new page without warning the user first.
- Use always unobtrusive scripting: Markup should be completely free of any script code. Avoid including script in
<script>sections within the document.
- Code always using the DOM (Document Object Model). The DOM is a way of representing structured documents (HTML or XML, for example) independently of any programming language, avoiding browser compatibility problems. Some of the advantages of scripting the DOM are:
- Separation: functionality added in script is separate from the structure/content layer and the presentation layer.
- Compatibility: using the DOM easily avoids incompatibility problems.
- Accessibility: if scripting is turned off, the scripted functionality does not work, but the user can still access the underlying information.
Many standard scripts are available on specialised websites. These usually need additional configuration and customisation and you should always check browser compatibility. Pay attention to copyright restrictions.
For interactivity, Java is mostly used to create little interactive elements in web pages – like navigation tools involving actions triggered by the user, mouse-over image changes, sound effects and the possibility to add interactive features. Applets can be used for all kinds of things: calculators, calendars, clocks, text effects, scrolling banners, games, etc.
Java-compatible browsers are a must to make the most of the possibilities offered by interactivity. Accordingly, on EUROPA you must offer alternative means of providing the same functionalities for browsers that don't work with Java.
Guidelines and references
- Standard ECMA-262
- Document Object Model
Please consult Syslog, the training information system, which gives you access to the training catalogue, the training map and allows you to introduce your application for a training course.