The main reason I've seen that error come up in javascripts is because a form name or field name has been misspelled somewhere. Tonight, while I combed over every name until my vision was crossed – I discovered a new reason why you might get this error:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
I was working with CubeCart – and that's their default. I usually use:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Hope that saves someone else some pain…