259 function isNumeric(strString) {
260 var strValidChars = "0123456789";
261 var strChar;
262 var blnResult = true;
263
264 if (strString.length == 0) {
265 return false;
266 }
267
268 // Test strString consists of valid characters listed above
269 for (i = 0; i < strString.length && blnResult == true; i++)
270 {
271 strChar = strString.charAt(i);
272 if (strValidChars.indexOf(strChar) == -1)
273 {
274 blnResult = false;
275 }
276 }
277 return blnResult;
278 }
Firefox crashes on line 264 with the following message:
strString is undefined
Why does this code fail? strString is a formal parameter of the isNumeric function, so it should always be defined.
The code calling your function is not providing a defined value for that variable.