Oggetti di livello superiore di Javascript
Windows, l’oggetto client di livello superiore, contiene quattro oggetti secondari. Questi oggetti rappresentano la base per tutti gli altri oggetti che verranno utilizzati per la programmazione in Javascript.
- Document
- Frame
- History
- Location
Primo esempio:
<html>
<head>
<title>JavaScript </title>
</head>
<body>
<script type=”text/javascript”>
var carLength = 4 + 5;
document.write(carLength + “<br>”);
carLength = 4 + 5 + ” feet”;
document.write(carLength);
carLength = “<br>Length in feet: ” + 4 + 5;
document.write(carLength);
carLength = “<br>Length in feet: ” + (4 + 5);
document.writeln(carLength);
</script>
</body>
</html>