问题
Is there anyway to call a JavaScript function from .NET Compact Framework through the WebBrowser control?
回答1:
It works with the Navigate() Method. I just tried it with the Windows Mobile 5.0 Pocket PC Emulator.
For example:
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()"));
来源:https://stackoverflow.com/questions/3135586/call-javascript-function-from-net-compact-framework-in-webbrowser-control