GetRef 函數(shù)可把一段 VBScript 過程(子程序)連接到頁面的一個 DHTML 事件上。
語法Set object.event=GetRef(procname)
參數(shù)描述
object 必需的。事件所關(guān)聯(lián)的對象的名稱。
event Required. 要與函數(shù)綁定的事件的名稱。
procname Required. 與事件關(guān)聯(lián)的 Sub 或 Function 過程的名稱。
實(shí)例
Function test()
dim txt
txt="GetRef Test" & vbCrLf
txt=txt & "Hello World!"
MsgBox txt
End Function
Window.Onload=GetRef("test")