ScriptControl怎样获取javascript返回的数组?
代码如下:#include <Array.au3>#include <File.au3>
$jsCode = FileRead(@ScriptDir & "\js.js")
If @error Then MsgBox(0,"", "没读到js文件")
$nJS = ObjCreate("ScriptControl")
$nJS.language = "JavaScript"
$nJS.addcode($jsCode)
$nResult = $nJS.eval('gets()')
If @error Then MsgBox(0,"eval",@error)
If IsArray($nResult) Then
_ArrayDisplay($nResult)
Else
ConsoleWrite($nResult)
EndIfjs代码:function gets()
{
return Array(1,2,3,4,5,6,7,8,9);
}
页:
[1]