You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a feature that is not described in the docs on Javascript interop. This feature is that this code will automatically download the js file when the page is navigated to. In other words, there is no need to add a script tag to the App.razor file. In fact, if you do add it, it will not download successfully. To see this issue, uncomment the script tag in App.razor to force the browser to attempt to download it.
I would suggest adding text to describe this feature so that the user does not try to manually add the script tag, and also it is a really cool feature.
This issue has been marked for triage on the Blazor Docs GitHub project, and I'll respond as soon as I return from the holiday vacation after New Year's.
We only work on documentation on this repo. If you need product support, close this issue and seek assistance through one or more of the following support channels:
If you think that you found a potential bug in the framework or have product feedback, close this issue and open a new issue for the ASP.NET Core product unit at dotnet/aspnetcore issues. Bug reports require a clear explanation of the problem, usually including a minimal repro project placed on GitHub for the product unit engineers to download and run. If you determine with the product unit that it isn't a bug but merely requires documentation, please re-open this docs issue and place a cross-link to your engineering issue discussion.
For problems or feedback on Visual Studio, close this issue and use the Report a Problem or Suggest a Feature processes from within VS, which open internal issues for the VS product unit. For more information, see Visual Studio Feedback.
For problems with Visual Studio Code, close this issue and ask for support on community support forums. For bug reports and product feedback, open an issue on the microsoft/vscode GitHub repo.
Description
There is a feature that is not described in the docs on Javascript interop. This feature is that this code will automatically download the js file when the page is navigated to. In other words, there is no need to add a script tag to the App.razor file. In fact, if you do add it, it will not download successfully. To see this issue, uncomment the script tag in App.razor to force the browser to attempt to download it.
Here is a simple Repro: https://github.com/gregoryagu/CallDotNetFromJs/
I would suggest adding text to describe this feature so that the user does not try to manually add the script tag, and also it is a really cool feature.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/location-of-javascript?view=aspnetcore-9.0#load-a-script-from-an-external-javascript-file-js-collocated-with-a-component
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/javascript-interoperability/location-of-javascript.md
Document ID
af240267-89c0-f192-7807-cf426001ad8d
Article author
@guardrex
Related Issues
The text was updated successfully, but these errors were encountered: