Issue #2252💬 AnsweredOpened September 8, 2019by mariasmol0 reactions

Preview mode does not run the scripts

快速解答by artf

Scripts are working, the problem is that your script was already executed inside the editor and the preview mode doesn't re-render the content... For any custom behavior, I would suggest creating your own preview command

Read full answer below ↓

Question

Hi all, I am checking Grapesjs for our product After allowing scripts in the editor and ,writing this simple example image i pressed the import and indeed saw the hello world which is great. however when using the preview mode i don't see the alert ( or anything else i tried instead of the alert) . how can i make it work? Do i need to configure something to execute scripts in preview mode? thanks for the help!

Answers (1)

artfSeptember 14, 2019

Scripts are working, the problem is that your script was already executed inside the editor and the preview mode doesn't re-render the content... For any custom behavior, I would suggest creating your own preview command

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.