Script tag create JSON error
https://stackoverflow.com/questions/28259389/how-to-put-script-in-a-javascript-string
Read full answer below ↓Question
Hi. I'm creating blocks in Grapesjs and I need to use JS on them for hover effect and more.. Everything works fine for the creation, store, load and the style of each blocks. I have a problem when I add the <script></script> tag to my block. It works fine when I drag the block for the first time but when I store and reload the page (so i load what i stored in db) I'm having a JSON error.. Here is my code : Here is my error : More info : I did add the allowScripts: true line and It seems to come from the gjs_components content that i stored in db.. Thanks for help..
Answers (3)
Sorry, I tried to follow the tips in the stackoverflow post but nothing works.. still got that error even if I escaped the / from the </script> tag
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 #1763
Add <Style> tag in block content objects (not a string)
Browser = ChromeGrapesJS = Latest version ( 0.14.52 ) I am trying to create a block includes nesting content object with script, style, typ...
Issue #1566
Default style for custom blocks
Hi, I'm using GrapesJS to a page builder inside a Prestashop website. The idea is to set default template stored in DB with custom Blocks....
Issue #511
Cannot edit the content after update it via block manager API
Hello @artf sorry for my last issue, I must create a new issue, my problem is got error like this EDIT : sorry i just fixed my last issue w...
Issue #846
Error when I tried to add rows to a table
Hi guys I'm starting to use Grapesjs and I have a problem, I am trying to add 3 new commands to create tables, add rows and cells, the tabl...
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.