Internet explorer 如何从html调用vbscript函数?

Internet explorer 如何从html调用vbscript函数?,internet-explorer,vbscript,onclick,Internet Explorer,Vbscript,Onclick,这就是我目前所拥有的。我正在尝试使用IE进行用户输入。我所需要的帮助就是调用myfunc()的“OnClick”东西 “全局变量” 变暗对象,屏幕,w,h GetClient '=================================================================================下面的子组件和函数================================================= 子GetClient Set objIE=

这就是我目前所拥有的。我正在尝试使用IE进行用户输入。我所需要的帮助就是调用myfunc()的“OnClick”东西

“全局变量”
变暗对象,屏幕,w,h
GetClient
'=================================================================================下面的子组件和函数=================================================
子GetClient
Set objIE=CreateObject(“InternetExplorer.Application”)
设置屏幕=ObjIE.Parent
w=屏幕宽度
h=屏幕高度
让IE看起来像一个输入框
objIE.Navigate(“关于:空白”)
objIE.Document.Body.Style.overflow=“自动”
objIE.document.title=“-----------------BITB客户端------------------”
objIE.visible=true
objIE.MenuBar=False
objIE.ToolBar=False
objIE.AddressBar=false
objIE.resizeable=False
物体宽度=400
物体高度=280
对象左=(w/2)-200
objIE.Top=(h/2)
'获取输入的html表单
objIE.Document.Body.InnerHTML=“-请选择下面列出的客户端-

”_ & "" _ &“176
”_ &“515
”_ &“760
”_ & "" _ & "" 端接头 函数myfunc() msgbox“太棒了” 端函数

我到处都找过了,我不明白为什么这样不行。如果有人能帮忙,我们将不胜感激。另外,如果有人想使用能够识别所选单选按钮的功能,请直接操作。

将代码更改为以下内容:

'global variables
Dim objIE, screen, w, h

GetClient
Do While objIE.document.All.OK.Value = 0
  WScript.Sleep 200
Loop
myfunc
objIE.Quit

'==========================SUBS AND FUNCTIONS BELOW==========================
Sub GetClient
  Set objIE = CreateObject("InternetExplorer.Application")
  ...
  objIE.Top           = (h/2)

  'html form to get input
  objIE.Document.Body.InnerHTML = "<p>-Please choose a client listed below-</p>" _
    & "<!--form-->" _
    & "<input type=""radio"" name=""client"" value=""176"">176<br&g;" _
    & "<input type=""radio"" name=""client"" value=""515"">515<br>" _
    & "<input type=""radio"" name=""client"" value=""760"">760<br>" _
    & "<input type='hidden' id='OK' value='0'>" _
    & "<input type=""submit"" value=""submit"" OnClick=""VBScript:OK.Value=1"">" _
    & "<!--/form-->"
end sub

function myfunc()
  msgbox "yay it works"
end function
“全局变量”
变暗对象,屏幕,w,h
GetClient
当objIE.document.All.OK.Value=0时执行
WScript.Sleep 200
环
myfunc
objIE,退出
'==========================================下面的子项和函数==========================
子GetClient
Set objIE=CreateObject(“InternetExplorer.Application”)
...
objIE.Top=(h/2)
'获取输入的html表单
objIE.Document.Body.InnerHTML=“-请选择下面列出的客户端-

”_ & "" 端接头 函数myfunc() msgbox“太棒了” 结束功能
'global variables
Dim objIE, screen, w, h

GetClient
Do While objIE.document.All.OK.Value = 0
  WScript.Sleep 200
Loop
myfunc
objIE.Quit

'==========================SUBS AND FUNCTIONS BELOW==========================
Sub GetClient
  Set objIE = CreateObject("InternetExplorer.Application")
  ...
  objIE.Top           = (h/2)

  'html form to get input
  objIE.Document.Body.InnerHTML = "<p>-Please choose a client listed below-</p>" _
    & "<!--form-->" _
    & "<input type=""radio"" name=""client"" value=""176"">176<br&g;" _
    & "<input type=""radio"" name=""client"" value=""515"">515<br>" _
    & "<input type=""radio"" name=""client"" value=""760"">760<br>" _
    & "<input type='hidden' id='OK' value='0'>" _
    & "<input type=""submit"" value=""submit"" OnClick=""VBScript:OK.Value=1"">" _
    & "<!--/form-->"
end sub

function myfunc()
  msgbox "yay it works"
end function