GrapesJs ignores <script> tags of templates (updated)
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)
Figured. Sorry. For those who might benefit from this, you have to set allowScript to '1' in init.
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.
Issue #890
[Question]: I cannot get the simple example working
I am not new to Javascript but when I try the example: I get a blank page. That is with adding the CSS and Javascript library. Any suggesti...
Issue #754
ES6 class in component script
I would like to use ES6 classes in the components script attribute. When I drop the component onto the canvas the error message "_classCall...
Issue #1533
Color picker goes outside the editor screen when NOT FULL SCREEN
Hi, I have successfully contained div id="gjs" inside of another div container with left side menu and top menu. It's working well, but the...
Issue #1064
[Question] Editor only meant to be fullscreen?
I have successfully contained div id="gjs" inside of another div container so that it would not take up the full screen. I am doing this so...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.