0
votes

I am working on a project with the help of Blazor web assembly and jquery "On" method is not working and getting below error

enter image description here

I have already added jquery min file and js file which have my method that not working

enter image description here

Error line in java script which is available in custom.js

enter image description here

1
@Arun, "placeholder" has no vale outside the "if" -you has malpositioned the } of the "if", you should write if(..){var placeholder=..;placeholder.on('click',function (ev){...})} - Eliseo

1 Answers

0
votes

Have you used js interop?by calling your js method inside razor page just call your method like this:

@inject IJSRuntime jsRuntime
@code{
protected override async Task OnAfterRenderAsync(bool firstRender)
{
    if (firstRender)
    {
        await jsRuntime.InvokeVoidAsync(identifier: "inititCustomDropdwon");
    }
}

}