Calling a JavaScript Function from the .NET Compact Framework in a WebBrowser Control

Can I call a JavaScript function from the .NET Compact Framework through a WebBrowser control?

+4
javascript compact-framework webbrowser-control
source share
1 answer

It works with the Navigate () method. I just tried it using Pocket PC emulator for Windows Mobile 5.0.

For instance:

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()")); 
+4
source share

All Articles