Hi again!
My problem is almost solved!
I've changed js file path with add "./" at first of each file and works :
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await _jsRunTime.InvokeAsync<IJSObjectReference>("import", "./js/bootstrap.bundle.min.js");
await _jsRunTime.InvokeAsync<IJSObjectReference>("import", "./js/jquery-3.6.min.js");
await _jsRunTime.InvokeAsync<IJSObjectReference>("import", "./js/wheel-zoom.min.js");
await _jsRunTime.InvokeAsync<IJSObjectReference>("import", "./js/app.js");
}
}
But i have another problem, after my webpage loaded, i'm facing this error in browser console :
jquery-3.6.min.js:2 jQuery.Deferred exception: $(...).tooltip is not a function TypeError: $(...).tooltip is not a function
at HTMLDocument.<anonymous> (http://localhost:5231/js/app.js:3:37)
at e (http://localhost:5231/js/jquery-3.6.min.js:2:30038)
at t (http://localhost:5231/js/jquery-3.6.min.js:2:30340) undefined
S.Deferred.exceptionHook @ jquery-3.6.min.js:2
t @ jquery-3.6.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.6.min.js:2
c @ jquery-3.6.min.js:2
add @ jquery-3.6.min.js:2
(anonymous) @ jquery-3.6.min.js:2
Deferred @ jquery-3.6.min.js:2
then @ jquery-3.6.min.js:2
S.fn.ready @ jquery-3.6.min.js:2
S.fn.init @ jquery-3.6.min.js:2
S @ jquery-3.6.min.js:2
(anonymous) @ app.js:2
jquery-3.6.min.js:2 Uncaught TypeError: $(...).tooltip is not a function
at HTMLDocument.<anonymous> (app.js:3:37)
at e (jquery-3.6.min.js:2:30038)
at t (jquery-3.6.min.js:2:30340)
What's the problem & how to solve it?
Note : In my main web-page (outside of my blazor project which works correctly), the file (bootstrap.bundle.min.js) imported with defer attribute whereas i did not set defer attribute in my blazor project. Is my problem is related to this issue? If yes, how to add defer attribute in my blazor project when importing js file via IJSRuntime.InvokeAsync?
Thanks in advance