好吧基于这篇文章:The same as this one
我试过这样做:
Call mFramePesquisa.parentWindow.execScript("gotoPage(pesquisa.html?re_ligacao)", "JavaScript")如您所见,js函数只有一个参数"pesquisa.html?re_licagao“,但是当在浏览器上执行时,它会出现一个错误,即":”是预期的。
因此,我尝试引用函数参数,但没有成功:
Call mFramePesquisa.parentWindow.execScript("gotoPage(" & chr(34) & "pesquisa.html?re_ligacao" & chr(34) & ")", "JavaScript")或
Call mFramePesquisa.parentWindow.execScript("gotoPage('pesquisa.html?re_ligacao')", "JavaScript")两者都在ie浏览器上抛出一个“对象预期”错误。
有什么建议吗?
thx
PS:我也试过用chr(63)代替"?“但没有成功。
编辑:我怀疑它与用作参数的字符串有关,因为在原始的JS中,函数的调用方式类似于对象在onChange上的调用:
onchange=javascript:gotoPage(this.value)发布于 2010-12-14 21:14:41
这在测试页面中对我起了作用:
IE.document.parentWindow.execScript "RunMe(""hello"")", "jscript"时间
https://stackoverflow.com/questions/4433316
复制相似问题