Javascript – How to initialize a canvas and pass it to other functions?
I am trying to add fabric.js to an empty Blazor server-server side app. I did the following: Added the following scripts in _Host.cshtml <script src="https://unpkg.com/fabric@latest/dist/fabric.js"></script> <script src="~/js/ImageEditor.js"></script> Created this file under wwwroot/js: window.fabricFunctions = { setup: function() { var canvas…