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