Browser console show “Uncaught ReferenceError: [functionName] is not defined”

The following code in the classic asp file (test.asp) that occurs Uncaught ReferenceError: abcFunc is not defined in browser console.

<input name="testFileList" type="hidden" value="<%=myFileList%>" id=" testFileList ">
<script type="text/javascript" language="javascript">           
refreshMyFile(document, abcFunc(document.getElementById("testFileList ")));
</script>

I try to put dim abcFunc in test.asp, it occurs Name redefined error.

I also try to change from

<script language="text/javascript">

to

<script>

It shows the same error in in Chrome console Uncaught ReferenceError: abcFunc is not defined .

If I don’t use abcFunc, no error in Chrome console. So I focus on abcFunc.

<script type="text/javascript" language="javascript">           
 refreshMyFile(document, document.getElementById("testFileList"));
</script>

However I check the abcFunc Function, the code seems normal.

Function abcFunc(byval Str)
 if Len(Str) <> 0 then
  Str = Replace(Str,Chr(59),"&#59")
  Str = Replace(Str,Chr(34),"&#34")
  Str = Replace(Str,Chr(60),"&#60")
  Str = Replace(Str,Chr(62),"&#62")
  Str = Replace(Str,Chr(13),"<br>")
  abcFunc=trim(Str)
 else
  abcFunc = ""
end if
End Function

I view these questions but don’t have idea how to solve it.

Uncaught ReferenceError: ‘functionName’ not defined

Uncaught ReferenceError – Function is not defined

Uncaught ReferenceError: [functionName] is not defined

Uncaught ReferenceError: [ function_name ] is not defined

Uncaught ReferenceError: functionis not defined error, why?

I will appreciate your advice with this issue. Thanks