Chapter 13: The High-Fashion World of Modeling: The Object Model

The Object Model is your window on Intenet Explorer. By a lucky coincidence, it also works pretty well as a window on Netscape Navigator, since the models are very similar. So similar in fact, that Internet Explorer's object model includes a component called Navigator. The Navigator object has lots of useful information about the browsers; see what your browser has to say about itself.

If you decide that your users have had enough browsing for one day, you can even cause their browser to quit. An example script shows how to link actions to some of the events included in the object model. Be careful before you try this out, because your browser will quit.

Here's the script which closes the browser down (and sends a nice goodbye message):

<HTML>
<BODY Language = "VBScript"  onLoad = "DoThis" onUnload = "DoThat">
<SCRIPT language = "VBScript">

Sub DoThis
	window.close
End Sub

Sub DoThat
	MsgBox "Why do I always have to clean up the mess?"
End Sub

</SCRIPT>
</BODY>
</HTML>