有没有办法通过WebBrowser控件从.NET Compact Framework调用JavaScript函数?
它使用Navigate()方法。我刚刚用Windows Mobile 5.0 Pocket PC模拟器尝试了一下。
例如:
webBrowser1.DocumentText = @"<html><head>
<script type='text/javascript'>
function doIt() {
alert('hello again');
return 'i did it!';
}
</script>
</head><body>hello!</body></html>";
webBrowser1.Navigate(new Uri("javascript:doIt()"));