动态获得图片路径(难度系数5星)

function getpath() { var theResult; theResult=scanfigner.GetImgPath(1,1); document.write(theResult); } function scan() { scanfigner.ExeScan(1,1); }

[color=red]theResult[/color]是动态获得的路径,比如:c://RollFiner_1.bmp或 c://RollFiner_2.bmp 或c://RollFiner_3.bmp等等。

[b]问题补充:[/b]
不用管方法对不对。theResult能得到
就看中能不能得到theResult.有什么思路呀。
[b]问题补充:[/b]
document.write(theResult); 打出来就是c://RollFiner_1.bmp或 c://RollFiner_2.bmp 或c://RollFiner_3.bmp等等。

[b]问题补充:[/b]
theResult是用C++写的。我也不懂,就让拿过来用。src里不知道怎么写

[code="js"] <br> function getpath() <br> { <br> var theResult; <br> theResult=scanfigner.GetImgPath(1,1); <br> document.write(theResult); <br> }<br><br> function scan() <br> {<br><br> scanfigner.ExeScan(1,1);<br><br> } <br>
[/code]

比如说,给你的img加一个id,比较方便,改一下你的js的代码。

[code="js"]
function getpath()
{
var theResult;
theResult=scanfigner.GetImgPath(1,1);
document.getElementById("img").src=theResult;
}

[/code]

是这个意思??

不知道你所谓的动态获得是什么意思。。这些函数方法看起来也不对啊,外面怎么定义的?

如果你的document.write(theResult)可以打印出正确的结果,那上面我的代码应该就是可以用的,你试试。