We are using a JavaScript on our CHM contents page to display the date modified of the file, so we can make sure we are testing the latest release (this probably won't be shipping out). Our Documentation computers are not having any issues (XP Home SP2), but two of the QA computers are (one XP Pro SP2 and one Vista Business release). They both display an ActiveX warning message:
The script we are using is a modified version of the MSDN example:
Code: Select all
<SCRIPT Language="JavaScript">
<!--
myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
var X, Y, sl, a, ra, file;
ra = /:/;
a = location.href.search(ra);
if (a == 2)
X = 14;
else
X = 7;
sl = "\\";
Y = location.href.lastIndexOf(sl) + 1;
file = myActiveXObject.GetFile(location.href.substring(X, Y)+'apmain.chm');
Date.prototype.toDateString = function () {return [['January ', 'February ', 'March ', 'April ', 'May ', 'June ', 'July ', 'August ', 'September ', 'October ', 'November ', 'December '][this.getMonth()], this.getDate(), ', ', this.getFullYear()].join('')}
document.write("Beta Updated: " + (new Date(file.DatelastModified).toDateString()));
//--></SCRIPT>
What would cause some computers to allow this, and some not to? All are running the file locally (as you must for client-side Javascript functions, and CHMs in general). We also use a variation of this code to launch our external tutorials (standalone DemoShield projects) and open the programs, which I'm sure will also cause this warning.