Like most applications we have a
file in the application directory, which starts the application running by loading the main page. Because we're only supporting one browser (IE4/5) we need to check that the user has this browser to prevent the pages appearing to be broken when run on other incompatible browsers.default.htm
Checking the Browser Version
Here's the complete
page. We use client-side code to detect the browser version and load the main default.htm
page into the full browser window if it's IE4 or better. If not, we display a message telling the user what happened:wroxcars.asp
<HTML>
<HEAD>
<TITLE>Loading, please wait..</TITLE>
<SCRIPT LANGUAGE="VBScript">
blnIE4 = False
strUA = navigator.userAgent
'use Microsoft's recommended browser type detection code:
intMSIE = Instr(strUA, "MSIE ") + 5
If intMSIE > 5 Then
If CInt(Mid(strUA, intMSIE, Instr(intMSIE, strUA, ".") _
- intMSIE)) >= 4 Then blnIE4 = True
End If
If blnIE4 Then top.window.location.href="wroxcars.asp"
</SCRIPT>
</HEAD>
<BODY>
<CENTER>
<H3>Sorry, this application requires Internet Explorer 4 or higher.</H3>
You can download the latest version of Internet Explorer from:<BR>
<A HREF="http://www.microsoft.com/ie/">http://www.microsoft.com/ie/</A>
</CENTER>
</BODY>
</HTML>