The tutorial you are viewing is a little bit outdated. But it is still mostly valid. The information, programming-wise that you are seeing has to do with JavaScript (which is in no way related to Java) also known as ECMAScript. As for Netscape, it is no longer being made, so anybody who uses Netscape as their browser to surf the Internet is at a loss. The main browsers you should worry about are Internet Explorer, Mozilla Firefox, and Apple Safari (most other browsers are based on these three, for example KDE's Konqueror in Linux is based on Safari). As for worrying about whether or not JavaScript works in the user's browser or is disabled, the best practice now is to enclose completely different web page source code inside of
- Code: Select all
<noscript>
</noscript>
tags. The correct method of using the DOM in programming is to use constructive and destructive XML-based methods. This basically means that instead of document.write("<i>Hello World!</i>") you would use
- Code: Select all
var el = document.createElement("i"); // Create a new i-element
// Add a text node containing the text 'Hello World!' to it
el.appendChild(document.createTextNode("Hello World!"));
document.body.appendChild(el); // Add the new i-element to the document body.