- Alternative technologies
- Modify HTML page, write text in it, add or remove tags, change styles etc.
- Execute code on events: mouse clicks and movements, keyboard input, etc.
- Send requests to server and load data without reloading of the page. This technology is often called "AJAX".
- Get and set cookies, ask for data, output messages…
- …And much, much more!
But execution in browser context implies certain security limitations.
There are at least three killing points about it.
- Full integration with HTML/CSS
- Simple things can be done simply
- Supported by all browsers and enabled by default
The mix of the advantages cannot be found in any of other technologies.
When you plan to study a technology, say invest your time, it is always good to overview the trends.
Besides the modern ECMAScript specification, which enhances the language itself, the browsers-makers are adopting features from HTML 5. That’s a related standard, or more precisely a pack of standards, containing many features which people have been wanting for ages.
Just a few:
- Reading/writing files on visitor’s disk (with proper security to keep it safe).
- A database embedded into the browser, which allows to store data on client side.
- Multithreading (can use multiple CPUs).
- Video playback.
- Drawing 2d and 3d, with hardware acceleration, just like in modern games.
Most topics of HTML5 are still in “draft” stage, but browsers tend to adopt them.
The title “HTML5” is a bit misleading. As you saw, the new standard is not just about HTML, but about interaction and advanced browser features.
It is also very important that new standards HTML5 and ECMAScript 5/6 are mostly compatible with older standards. That means they don’t break existing apps.
Well, to be sincere, there is a minor problem with HTML5, named “Browsers run too fast”. Sometimes browsers adopt a feature which is in not fully described in the standard (draft stage), just because it is so cool they can’t wait.
But then, with time, the standard evolves and changes, so browsers have to reimplement or correct the feature. This breaks the code which relied on the earlier version. So we’d better think twice before using such draft-stage solutions. This mainly refers to an advanced stuff.
The trend is: things are going to be compatible.
Of course as far as we don’t use browser-specific features or early-adopted draft sections of a standard.
A Java applet is a program for a browser just like an executable file. A programmer writes it in Java, then compiles and puts a link on it into HTML. A browser then opens a page, finds the reference to an applet, downloads and executes it (if Java is enabled).
- Java can do everything, just like an installed executable. For security, an unsafe action requires visitor’s confirmation.
- Java development is easier: IDEs are cool.
- Java takes more time to load and is heavy to start running.
- Java needs to be installed and enabled.
- Java is not integrated with HTML page, it runs in a separate container within the page.
Adobe Flash initially appeared as a cross-browser platform and language for multimedia, for making web alive with animation, audio and video. But there are other interesting features in Flash.
A flash movie is a compiled program, written in ActionScript, usually bundles with images and other resources.
- Great stuff for networking (sockets, UDP for P2P)
- Support for complex multimedia: images, audio, video is much more advanced compared to HTML5. Camera and microphone are here too.
- Comfortable IDE for Flash, no browser incompatibilities.
- Flash has to be installed and enabled.
- Flash is not integrated with HTML page, it runs in a separate container within the page.
As of now, there is a high pressure on Flash monopoly in many areas of it’s use. For example, HTML5 provides means for browser to play video, draw, etc. Browsers which implement HTML5 stuff don’t require Flash to do such things. And most browsers really go forward in making HTML5 features work.
ActiveX, browser plugins/extensions
ActiveX is a great, but IE-only thing. It allows to write a program in C language which integrates with the page if the visitor allows.
- Integrated with HTML/CSS
- Written in C, hence very fast and featured.
- Can do everything if the visitor allows it to install.
- Internet Explorer only. Chrome has partial support that has to be enabled.
- Development of ActiveX is difficult.
Programs on Windows provide interfaces which can be used by ActiveX. So, a page can call Microsoft Word, or load a document into Excel, etc.
Other browsers allow to write plugins and extensions using NPAPI.
Personally, I’m not a Microsoft fan. But I saw great applications done with ActiveX, and I can understand why people are using it and bind themselves to Windows/IE.
Other technologies: Silverlight, XUL, VBscript
These technologies are much less widespread.
- XUL is a language for interfaces, useful if you only write for Mozilla browsers or making extensions to Firefox. Also used for desktop applications.
- Silverlight is an Adobe Flash competitor from Microsoft based on .NET. It runs best on Windows, the cross-platform support improves gradually time. Mostly used for Windows-based applications and intranet.
Examples are: selecting uploading multiple files at once (Flash), using camera and microphone (Flash), doing complex multimedia and graphics, including calculations (Flash, Java) and much more. You’ll meet them on your way.