How to programmatically free draw using Fabric js?
问题 Building a multiplayer doodle using fabric js. Trying to implement multiplayer doodle using fabric js, the idea is when U1 draws on canvas we push the points to RTDB and get those points on both the client and programmatically draw the stroke in both the clients. 回答1: You can save the canvas' data on path:created for example (or other event) using toJSON(). Send it to the server and the other client will load it using loadFromJSON(). var canvas = new fabric.Canvas(document.getElementById(