我在HTML页面中使用了下面的代码,但它正在返回NULL。(IE8,MS WIndows 7 Pro)
Set Sound = CreateObject("WMPlayer.OCX")我确信已经安装完毕,工作正常。
怎么修呢?
发布于 2015-11-24 19:08:55
似乎不可能像我在HTML中使用的那样使用Visual代码。
相反,我们必须在DOM中使用,如下所示
<body onload='' scroll="no">
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer"
width="0" height="0">
</object>之后,我们必须实现所有的方法来启动/停止音频/电影。
例如
<script type="text/vbscript" language="VBScript">
Set oElm = document.getElementById("WindowsMediaPlayer")
if oElm Is Nothing then
' MsgBox("element does not exist")
else
' MsgBox("element exists")
' MsgBox oElm
oElm.controls.stop()
oElm.URL = "C:\HTML\Sounds\oos.wav"
end if
<script> https://stackoverflow.com/questions/33898204
复制相似问题