Figure 1 Changing the Cursor
<SCRIPT LANGUAGE=vbscript>
<!--
Sub SetWait()
Dim i
For i =0 to document.all.length -1
If document.all(i).id = "button1" Then
document.all(i).value = "Cancel"
Else
document.all(i).style.cursor = "wait"
End If
Next
End Sub
-->
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Click button to Display hourglass (except over button)
</TITLE>
</HEAD>
<BODY>
<P>Hourglass Displayed</P>
<INPUT type="button" value="Button" id=button1 name=button1
onclick="SetWait()">
</BODY>
</HTML>
Figure 2 MSXML Detect
function isMSXML30()
{
var e = new Error();
var oXML = null;
try
{
// Try to create an MSXML 3.0 object using the version-dependent
// PROGID
oXML = new ActiveXObject("MSXML2.DOMDocument.3.0");
// Made it here, so this client has the "right" version of MSXML;
// return true after cleaning up.
oXML = null;
return true;
}
catch (e)
{
// Client is probably using MSXML 2.5 or 2.6;
// return false after cleaning up.
oXML = null;
return false;
}
}
Figure 4 Extended MSXML Detector
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XML Client Version Detector</title>
<style>
BODY
{
font-family: Verdana;
font-size: x-small;
}
BUTTON
{
font-size: 100%;
}
</style>
</head>
<body>
<h1>XML Client Version Detector</h1>
Click the "Detect XML Version" button below to get information about
the major XML version installed on this client.
<br>
<br>
<button onclick="GetXMLClientVersionInfo();">Detect XML Version</button>
<br>
<br>
<br>
Compliments of <i>Ken Stanfield</i>. Enjoy!
<script language="jscript">
function GetXMLClientVersionInfo()
{
// Create a new instance of the XMLClientVer object
var oXMLClientVer = new XMLClientVer();
// Display XML client version info
var sVersionInfo = "";
sVersionInfo += "MSXML4 = " + oXMLClientVer.bIsMSXML4 + "\n";
sVersionInfo += "MSXML3 = " + oXMLClientVer.bIsMSXML3 + "\n";
sVersionInfo += "MSXML2 = " + oXMLClientVer.bIsMSXML2 + "\n";
alert (sVersionInfo);
}
//*****************************
// XML Client Version Object
//*****************************
function XMLClientVer()
{
//*********************
// Public properties
//*********************
this.bIsMSXML4 = false;
this.bIsMSXML3 = false;
this.bIsMSXML2 = false;
//**********************************
// Private implementation details
//**********************************
var e = new Error();
var oXML = null;
// Try to load the most recent version of the MSXML parser;
// if that fails, try to load the next most recent version, and so on.
// Always test using the version *dependent* PROGID.
try
{
// Test for MSXML 4.0
oXML = new ActiveXObject("MSXML2.DOMDocument.4.0");
oXML = null;
this.bIsMSXML4 = true;
return;
}
catch (e)
{
try
{
// Test for MSXML 3.0
oXML = new ActiveXObject("MSXML2.DOMDocument.3.0");
oXML = null;
this.bIsMSXML3 = true;
return;
}
catch (e)
{
try
{
// Test for MSXML 2.0
oXML = new ActiveXObject("Microsoft.XMLDOM.1.0");
oXML = null;
this.bIsMSXML2 = true;
return;
}
catch (e)
{
// Stub
}
}
}
}
</script>
</body>
</html>
|