verbb / vizy

A flexible visual editor for Craft CMS
Other
43 stars 8 forks source link

Set onload to null #172

Closed leevigraham closed 1 year ago

leevigraham commented 1 year ago

Removes attribute from tag completely.

Embed plugin with null compared to Vizy with an empty string.

Screen Shot 2022-08-23 at 11 27 35 pm
engram-design commented 1 year ago

FYI, refer to the convo with @khalwat https://github.com/verbb/vizy/commit/060164c77027c2ad46c3599d233113494c12369a#commitcomment-77202104

Just need to ensure this doesn't break anything.

khalwat commented 1 year ago

I'm going to make some assumptions here... I'm assuming that the scripts are being loaded as modules. If that's the case, you can't depend on them necessarily loading in the particular order you want them to load.

If you have code that depends on these scripts being loaded, the best thing to do is to use the custom event as referenced above. It'll trigger that after the script has been loaded.

Setting it to null can cause issues with some scripts / inline JS assuming your scripts are already loaded, parsed, and executed when they may not have been.