I've a JavaScript file and it contains some methods. I want to call those methods from my winform application. Is it possible? If so can you give me a simple example?
I've tried like this
Process.Start("javascript:showuser('User1');return false;");
But it is not recogniging the showuser method. Because my js file is in remote location (ex : http://mysite.com/userprofile.js)
Can you help me to do this
Thank you
You could use a WebBrowser control. Here's a sample post.
webBrowser1.DocumentText =
@"<html><head>
<script type='text/javascript'>
function testFunction() {
alert('test');
}
</script>
</head><body></body></html>";
webBrowser1.Document.InvokeScript("testFunction");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With