Components & JS Question
Probably you're not storing correctly https://grapesjs.com/docs/modules/Storage.html BTW you can add a script inside blocks but I highly recommend creating a custom component for that case
Read full answer below βQuestion
Hi,
In your Components & JS documentation, it is mentioned that scripts can be added into the "block" section under a script attribute.
However, after some trial and error, whenever the page is saved and reloaded, the script seems to have disappeared.
When I tried to add the script into the "model" section instead, it seems like it becomes permanent. Why is this so?
Answers (2)
Probably you're not storing correctly https://grapesjs.com/docs/modules/Storage.html BTW you can add a script inside blocks but I highly recommend creating a custom component for that case
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 #4606
A script delcaration mistake at "Commponent & JS" documentation page.
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? irrelevant to the issue Reproducible demo...
Issue #792
Script property using function don't work with blocks
In Components & JS docs there's this example: This works perfectly. But I couldn't use a function instead of a string in script, as is said...
Issue #1559
Issue: broken links in docs
I've found a pair of broken links in docs https://grapesjs.com/docs/modules/Components/ in page https://grapesjs.com/docs/modules/Blocks.ht...
Issue #1030
[Question] Firing events with custom components
I'm trying to build a plugin for Grapesjs with some custom components, and I'm having trouble with triggering events and interacting with t...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.