简体   繁体   中英

How to load jQuery inside a Blazor web app?

How to load jQuery inside a Blazor web app?

https://blazorfiddle.com/s/5m3lsxtm

JQuery library does load, the issue is that document.ready is called before the blazor component is rendered to the page you can see the error in the console indicating $ is not defined, I would suggest that you would change the function to a named function (js function on page) and call in with JsRuntime.InvokeVoidAsync while overriding the function OnAfterRender of the blazor component.

Hope that make any sense

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM