当前位置:编程学习 > C#/ASP.NET >>

C# webbrowser 调用JS脚本

HTML1:<select name="gnid" class="text_12 typle="width:120" onchange="showGnid(this.value)""
HTML2:<input name="b" type="test" class="god_left" size="17" value="c" maxlength="7" onKeyDown="if(event.keycode==13) search_vev()" onfocus="movelast()">

我使用webbrowser触发以上两个脚本

mshteml.IhtemWindows win=(mshteml.IhtemWindows)doc.parentWindows;
win.execScript("showGnid(this.value)","javascript")  没有问题
 
触发HTML2
mshteml.IhtemWindows win=(mshteml.IhtemWindows)doc.parentWindows;
win.execScript("if(event.keycode==13) search_vev()" javascript")时报错

提示脚本错误(缺少对象) 异常来自 HRESULT:0x80020101

小弟对JS脚本基本不懂,求教这是怎么个问题,该怎么样处理!谢 --------------------编程问答-------------------- 嘛问题啊 --------------------编程问答-------------------- 触发HTML2  javascript 是不是少了“
 
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,