Issue #3238Opened January 18, 2021by sizhousama1 reactions

[Question]: How to load external javascript,i tried all methods,Useless

Question

I write html strings as blocks, and need to introduce a lot of external scripts and styles, but I tried all the methods, when I drag the block to the canvas, the script does not take effect, but styles can be loaded,I hope to get help。 1. Load by appendchild image

init load by canvas:{scripts:[...]} image

who can help me?

Answers (2)

harsh201January 20, 20211 reactions

@sizhousama I am loading scripts/stylesheets via canvas while initializing grapesjs editor and it works for me.

 canvas: {
          scripts: ['https://unpkg.com/abc.js'],
          styles: ['https://unpkg.com/abc/dist/css/abc.min.css'],
        },

More details can be found here. Hope it helps!

sizhousamaJanuary 18, 20210 reactions

The console shows loaded image

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.