我在经典的asp页面的标签中声明了以下函数,我没有写但需要编辑;
<SCRIPT language="VBScript">
sub confirmuser(sSubtype, sAction)
' this prompts user to confirm their action and sets hidden form fields.
' current subtypes are 1) Free Trial 2) Equity 3) Mutual Funds.
' current actions are 1) subscribe 2) unsubscribe
sConfirmMessage = "Clicking on the OK button below will " & sAction & " login <%=rtrim(session("WebID"))%> " & _
"to the " & sSubtype
if sSubtype = "Free Trial" then
sConfirmMessage = sConfirmMessage & "."
else
if sAction = "subscribe" then
sConfirmMessage = sConfirmMessage & " Research Package at the stated rates. This charge will appear " & _
"on your commission statement."
else
sConfirmMessage = sConfirmMessage & " Research Package."
end if
end if
' if they click OK, then they want to go ahead and process. Save the necessary info
' in the two hidden form fields and post the form.
if msgbox(sConfirmMessage, VBOKCancel, "Please Confirm") = 1 then
window.frmSub.subType.value = sSubType
window.frmSub.action.value = sAction
window.frmSub.submit()
end if
end sub
</SCRIPT>
并且在尝试执行该功能的HTML输入中;
<CENTER><INPUT type='button' value='Sign Up' id='subaction' name='subAction' language='VBScript' onclick="vbscript:confirmuser('Equity','subscribe')"></CENTER>
当试图点击按钮时,我收到错误;
"Uncaught ReferenceError: confirmuser is not defined"
这个功能目前在网站上工作,所以我不知道为什么我收到这些错误,但我不是经典的asp / vbscript大师所以我希望有人可以帮助我。