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