Little Javascript Issue - CSV File

I’ve got a little issue that hopefully someone can help out with. I have a CSV file called names2.csv with the following data

Name,Date \

George,6/15/2010 \

Smith,6/11/2010 \

And here’s the code

<html>
<head>
<title>CSV &amp; Date parser</title>
<script type="text/javascript">
// From: http://codingforums.com/showthread.php?t=198171


function checkCSVdate() {
// ckDate = document.getElementById('dinfo').value;
  
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()

ckDate = (month + "/" + day + "/" + year);

var str = '';
fso  = new ActiveXObject("Scripting.FileSystemObject"); 
fin  = fso.OpenTextFile("names2.csv", 1, false, 0);
var line = fin.ReadAll();
  var tmp = line.split('\
');
  for (var i=0; i<tmp.length; i++) {
    temp = tmp[i].split(',');
    if (ckDate == temp[1]) { str += tmp[i]; }
  }
  if (str == '') { document.getElementById('mtchDiv').innerHTML = 'No matches found'; }
            else { document.getElementById('mtchDiv').innerHTML = str; }
}

onload = function() {

    checkCSVdate();

}

</script>
</head>
<body>
<div id="mtchDiv"></div>
</body>
</html>

Since the data file has a line with 6/15/2010, it should return “George”, right? It returns “No Matches Found”.

I’ve tested it on IE8 and FFox3

new ActiveXObject(“Scripting.FileSystemObject”);

is an Internet Explorer proprietary command so it isn’t going to work anywhere except on IE. With more recent versions of IE such as IE7 and IE8 it will also depend on the system security settings as to whether it will run. Most such activeX controls are disabled in those versions of IE as they present a security hole when enabled.

I’d expect the code to only work on IE6 unless you specifically adjust the security settings in IE7 or IE8 to allow it to run there as well.

What version of Internet Explorer is your intranet running?