Why use JavaScript?
With Blazor WebAssembly, you can create complete applications without directly using JavaScript. However, you may need to use JavaScript because there are some scenarios that you cannot accomplish without it. Without JavaScript, you can't manipulate the DOM or call any of the JavaScript APIs that we rely on for web development.
This is a sample of the things that you do not have access to directly from the Blazor WebAssembly framework:
- DOM manipulation
- The Media Capture and Streams API
- The WebGL API (2D and 3D graphics for the web)
- The Web Storage API (localStorage and sessionStorage)
- The Geolocation API
- JavaScript pop-up boxes (alert, confirm, prompt)
- The online status of the browser
- The browser's history
- Chart.js
- Other third-party JavaScript libraries
The preceding list is not at all comprehensive since there are hundreds of JavaScript libraries that are currently available. However, the key point...