H
hendedav
Gang,
I am trying to get a regular expression test to work and can't
figure out why. I will give you the code below:
for (var j=0; j<document.getElementById('cmbList').options.length; j+
+) {
if (document.getElementById('cmbList').options[j].value ==
object.firstChild.data) { strAnswer = "specific"; break; }
alert('does .' +
document.getElementById('cmbList').options[j].value + '. contain .' +
object.firstChild.data + '.');
if (/
^object.firstChild.data/.test(document.getElementById('cmbList').options[j].value))
{
alert('in matches');
strAnswer = "child";
break;
}
}
I know the everything is working except the test function due to the
alert statement and the output generated. The two values being
compared contain directory paths (ie '/some/dir') and I can see (by
the alert statement) while its comparing values that some directories
are child of the parent directory, yet the .test function fails. Is
there a better way to perform this loop or is there an error with my
test statement?
Thanks,
Dave
I am trying to get a regular expression test to work and can't
figure out why. I will give you the code below:
for (var j=0; j<document.getElementById('cmbList').options.length; j+
+) {
if (document.getElementById('cmbList').options[j].value ==
object.firstChild.data) { strAnswer = "specific"; break; }
alert('does .' +
document.getElementById('cmbList').options[j].value + '. contain .' +
object.firstChild.data + '.');
if (/
^object.firstChild.data/.test(document.getElementById('cmbList').options[j].value))
{
alert('in matches');
strAnswer = "child";
break;
}
}
I know the everything is working except the test function due to the
alert statement and the output generated. The two values being
compared contain directory paths (ie '/some/dir') and I can see (by
the alert statement) while its comparing values that some directories
are child of the parent directory, yet the .test function fails. Is
there a better way to perform this loop or is there an error with my
test statement?
Thanks,
Dave