Issue #1231💬 AnsweredOpened June 25, 2018by ivanezeigbo0 reactions

GrapesJs ignores <script> tags of templates (updated)

快速解答by ivanezeigbo

Figured. Sorry. For those who might benefit from this, you have to set allowScript to '1' in init.

Read full answer below ↓

Question

When I include templates inside the <div id="gjs"></div> tags. It appears that GrapesJs ignores the <script> tags, but every other tag like <link> would work pretty well. The javascript functions in the script tag would not be able to work on the editor because of this. My code is designed to readfile and locate the links of any src or href in the code for any template regardless of design so I cannot add the script tags manually since it has to be general purpose for any template regardless of the arrangement of its folders and directories. Please help. How do I make my #gjs accept my <script></script> tags instead of stripping them away. Tagging also @artf . Thank you!

Answers (2)

ivanezeigboJune 25, 2018

Figured. Sorry. For those who might benefit from this, you have to set allowScript to '1' in init.

lock[bot]September 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.