Remove type="text/javascript" attribute from script element created in blazor.webassembly.js
See original GitHub issueIs your feature request related to a problem? Please describe.
A script element added from blazor.webassembly.js has a type=“text/javascript” attribute which makes HTML validation fail after JS/Blazor has loaded. I’m publishing from microsoft.netcore.app.runtime.browser-wasm\5.0.1.
Describe the solution you’d like
There is no reason for using type attributes on script elements in HTML5 documents so just remove that attribute… The failing excerpt:
<script type="text/javascript">var Module; windo"...
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Issue with RenderFragment in Blazor after leaving page ...
Blazor needs the generated html to remain unaltered or it can't find elements reliably to remove from the DOM.
Read more >Adding script references in Blazor
Learn here about that how to add the script references manually in the Syncfusion Blazor Components.
Read more >ASP.NET Core Blazor JavaScript interoperability (JS interop)
Learn how to interact with JavaScript in Blazor apps. ... The <div> element is removed from the DOM along with the rest of...
Read more >Two Methods For Using DataTables.net JavaScript Library
The purpose of this document is to demonstrate two different ways to use the DataTables.net JavaScript library in Blazor Web Assembly.
Read more >Lift & Shift Existing Chrome Extension to Blazor ...
Throughout this post, I'm going to walk through how to migrate the existing Chrome extension with minimal code changes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Looked around and seems like this is the place (so TypeScript not .js)…
https://github.com/dotnet/aspnetcore/blob/6b95e58bb4d113d210e519b99f79365b8a5dbb19/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts#L208
Done in https://github.com/dotnet/aspnetcore/pull/29386