[英]Running Javascript along side C# using Blazor in headless browser
I'm trying to build a .NET core application that execute JavaScript, this JavaScript also need to call C# functions on CLR objects as well,I used JINT ( https://github.com/sebastienros/jint ) but it has one majeure disadvantage which i couldn't debug any JavaScript code. I'm trying to build a .NET core application that execute JavaScript, this JavaScript also need to call C# functions on CLR objects as well,I used JINT ( https://github.com/sebastienros/jint ) but it has one majeure disadvantage我无法调试任何 JavaScript 代码。 So thinking for alternative that using CEF sharp that will run Blazor to execute javascript alongside C#.因此,考虑替代方案,使用将运行 Blazor 与 C# 一起执行 javascript 的 CEF sharp。 is it possible?可能吗? Thanks!谢谢!
You can use JSInterop in blazor to communicate between JS and C#.可以使用 blazor 中的 JSInterop 来实现 JS 和 C# 之间的通信。
Read more here for calling JS from C#: https://docs.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-5.0在这里阅读更多关于从 C# 调用 JS: https://docs.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-5.0
And here for calling C# from JS: https://docs.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-dotnet-from-javascript?view=aspnetcore-5.0在这里从 JS 调用 C#: https://docs.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-dotnet-from-javascript?view=aspnetcore-5.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.