msgbox 浏览器不支持

T121581 2014-03-10 05:47:26
代码
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' 建立变量。
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分字符大小写。
regEx.Global = True ' 设置全局可用性。
Set Matches = regEx.Execute(strng) ' 执行搜索。
For Each Match in Matches ' 遍历匹配集合。
RetStr = RetStr & "Match found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))


在IE浏览器打开 可以弹出提示
但是用谷歌浏览器打开 就上面提示都没有 ? 是我电脑设置问题 还是谷歌浏览器不支持msgbox了?
...全文
3049 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dogfish 2014-04-24
  • 打赏
  • 举报
回复
vbscript好像只有ie才支持的。所以chrome没有反应。建议使用javascript
Go 旅城通票 2014-03-18
  • 打赏
  • 举报
回复
vbs只有IE核心的浏览器至支持,和msgbox没关系,改成js
    function RegExpTest(patrn, strng) {
        var rx = new RegExp(patrn, 'ig'), RetStr = '';
        while (m = rx.exec(strng)) RetStr += "Match found at position " + m.index + ". Match Value is '" + m + "'.\n"
        return RetStr;
    }
    alert(RegExpTest("is.", "IS1 is2 IS3 is4"))

4,008

社区成员

发帖
与我相关
我的任务
社区描述
它是一种微软环境下的轻量级的解释型语言,它使用COM组件、WMI、WSH、ADSI访问系统中的元素,对系统进行管理。
社区管理员
  • vbScript社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧