Issue #3238πŸ’¬ AnsweredOpened January 18, 2021by sizhousama1 reactions

How to load external javascript,i tried all methods,Useless

Quick answerby harsh201❀ 1

@sizhousama I am loading scripts/stylesheets via canvas while initializing grapesjs editor and it works for me. More details can be found here. Hope it helps!

Read full answer below ↓

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 (3)

harsh201β€’ January 20, 2021

@sizhousama I am loading scripts/stylesheets via canvas while initializing grapesjs editor and it works for me. More details can be found here. Hope it helps!

sizhousamaβ€’ January 18, 2021

The console shows loaded image

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @sizhousama. Great question about [Question]: How to load external javascript,i tried all methods,Useless. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() ev...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.