方法一:定义两段script,一个用javascript,一个用vbscript.函数可以直接调用.
<script language="javascript" type="text/javascript">
// <!CDATA[
function Button1_onclick() {
//execScript('msgbox abc(), 64, "rock"','vbscript');
abc();
}
function getDate()
{
return new Date();
}// ]]>
</script>
<script language="vbscript" type="text/vbscript">
function abc()
msgbox getDate(), 64, "test"
abc = "123"
end function
</script>
// <!CDATA[
function Button1_onclick() {
//execScript('msgbox abc(), 64, "rock"','vbscript');
abc();
}
function getDate()
{
return new Date();
}// ]]>
</script>
<script language="vbscript" type="text/vbscript">
function abc()
msgbox getDate(), 64, "test"
abc = "123"
end function
</script>
方法二:window.execScript(code, javascript/vbscript)
execScript('msgbox "aaa", 64, "rock"','vbscript');