Category : blazor

I’m migrating an existing website to Blazor WASM on .NET Core 5 and i’ve had some challenges initializing/calling this plugin from blazor. See HTML and JS code below: On my current website I initialize this plugin as follow: <script src="./hs-unfold.min.js"></script> <script> $(document).on(‘ready’, function () { // INITIALIZATION OF UNFOLD // ======================================================= var unfold = new ..

Read more

I have a javascript event called Hello addEventListener(‘hello’, function () { alert("event listener"); }) and in a other javascript function a raise the event.. let event = new Event("hello", { bubbles: true }); document.dispatchEvent(event); But what i want todo now is let event trigger a blazor function when the event occuers Not blazor should listen ..

Read more

I have implemented the following code in wwwroot – index.html: "use strict"; (() => { const modified_inputs = new Set; const defaultValue = "defaultValue"; // store default values addEventListener("beforeinput", (evt) => { const target = evt.target; if (!(defaultValue in target || defaultValue in target.dataset)) { target.dataset[defaultValue] = ("" + (target.value || target.textContent)).trim(); } }); // ..

Read more

Here I have blazor server app, I have two <select> cascading dropdown where on change of <select class="form-control classId select2" @bind="chapterModel.SchClassId"> dropdown I want list of subject based on selected <select class="form-control classId select2" @bind="chapterModel.SchClassId"> dropdown in another dropdown<select class="form-control subject select2" @bind="chapterModel.subjectId">. Since I am using select2 dropdown I have Js onchangefunction for dropdown ..

Read more

I’m using Chrome, I’ve got everything set up according to many stack overflow posts and google developer docs, however the issue is that the ‘push’ event doesn’t seem to be getting called. Here is my ‘push’ event… self.addEventListener(‘push’, event => { const payload = event.data.json(); event.waitUntil( self.registration.showNotification(‘My Website’, { body: payload.message, icon: ‘img/icon-512.png’, vibrate: [100, ..

Read more