I am trying to develop a plugin to internet explorer browser using csharp and I try to inject a javascript to the loaded page. To inject the javascript i used the following code. The code is injected and the alert is working fine. but code given below should return the value of "msg" to output. when i run this code i get null value for output. kindly help.
var output= HTMLDocument.parentWindow.execScript("msg()","JScript");
function msg(){
var msg = "This is sample";
alert(msg);
return msg;
}