Skip to content
Advertisement

Tag: synchronous

Conditionally load and then reference external JS

I’d like to load an external JS script based on a condition (the user’s screen width), then execute a script which references that external JS. I want to load the external JS as early as possible, so I’ve added it to the <head>, but when referencing the JS later in the <body>, it shows as undefined. I assume this is

Convert Blob to binary string synchronously

I’m trying to put image in clipboard when user copies canvas selection: So I thought the right way would be to convert canvas tu dataURL, dataURL to blob and blob to binary string. Theoretically it should be possible to skip the blob, but I don’t know why. So this is what I did: But when the DataTransfer object is used

Advertisement