The Dev Pages

A knowledge base for simple (and beyond) web applications development

Archive for the ‘Javascript and AJAX’ Category

So after being confused as to why I kept seeing the javascript error ‘missing ; before statement’, I realized that javascript variables can’t begin with a number.

My code was:

for (int i = 0; i < top; ++i) { eval("form." + fieldsArray[i] + ".value");

fieldsArray contains a string ‘0to99scans’ referring to a form input ‘0to99scans’. This should have been something like ‘zeroTo499scans’.