10
JavaScript Interop
In this chapter, we will take a look at JavaScript. In specific scenarios, we still need to use JavaScript, or we will want to use an existing library that relies on JavaScript. Blazor uses JavaScript to update the Document Object Model (DOM), download files, and access local storage on the client.
So, there are, and always will be, cases when we need to communicate with JavaScript or have JavaScript communicate with us. Don’t worry, the Blazor community is an amazing one, so chances are someone has already built the interop we need.
In this chapter, we will cover the following topics:
- Why do we need JavaScript?
- .NET to JavaScript
- JavaScript to .NET
- Implementing an existing JavaScript library
- JavaScript interop in WebAssembly ...
Get Web Development with Blazor - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.