In Blazor, the [JSInvokable] attribute is used
to annotate a method, enabling it to be invoked from JavaScript code. The prerequisite for this functionality is that the method must be declared as
public
.
Otherwise, a runtime error will be triggered when an attempt is made to call the method from JavaScript.