I have a function defined in a JS file.
Test.js
function fillData()
{
alert("fill");
}
I have loaded the js file in html file like this.
Index.html
<html>
<head>
<title>TEST</title>
</head>
<script src="./PathToJs/Test.js" type="text/javascript"></script>
<body>
<h1>Test Page</h1>
</body>
</html>
I am calling this function from c# using webbrowser InvokeScript method.
webBrowser.InvokeScript("execScript", new Object[] { "fillData()", "JavaScript" });
But the method is not getting called. There is no alert box coming.
If the Javascript method is defined in the HTML itself then fillData() method is getting called.
Let me know how to call the external JS methods using WPF WebBrowser.InvokeScript method.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…