Closed omarmd1986 closed 6 years ago
@omarmd1986 Can you share some insights on what was wrong and how did you overcome/fix it?
@cvetlicni you have to store/load JSON objects for editing purpose, read this: https://grapesjs.com/docs/modules/Storage.html#setup-remote-storage
@artf thanks for quick help, but my problem was actually way simpler.
I was already storing html, css, scripts into DB and loading them, but didn't have allow-scripts: 1
set.
For future references: You must allow scripts when you init grapesJS instance.
const editor = grapesjs.init({
...
allowScripts: 1,
});
The option allowScripts works fine for me.
How i can get script like css ( editor.getCss(); )
Hi, I'm using the grapes JS library to create an HTML. I added the slider plugin and everything goes fine the first time. The user creates the HTML and clicks on a button to save the changes. I get the HTML, CSS, and JS generated by Grapes JS and, save them in my database for future use. When I try to load the HTML, CSS, and JS generated by grapes JS to edit the changes that I've saved the slider doesn't work.
My question: How can I save my template whit component that needs JS and load again and the component still by a component? The grapes js remove all the scripts.