GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.06k forks source link

[QUESTION] Javascript Deletes #837

Closed RiyaThete closed 6 years ago

RiyaThete commented 6 years ago

Whenever I import, using import plugin, javascript part of the code is deleted. Is there any way to preserve it? I want to used the exported html file directly, but cannot use it now because javascript is missing in it

arthuralmeidap commented 6 years ago

What is the name of the plugin?

RiyaThete commented 6 years ago

image

The 3rd last import plugin .It is available on http://grapesjs.com/demo.html

arthuralmeidap commented 6 years ago

try to run editor.getJs(). see if it returns the previous imported JS.

artf commented 6 years ago

You have to set allowScripts to true

grapesjs.init({
  ...
  allowScripts: true,
})
RiyaThete commented 6 years ago

@artf Thank you so much ... you saved me from writing a workaround for it.

Deepak813 commented 5 years ago

Hello @artf,

How we can get the particular script based on selected element as provided code "editor.getJs()" provides all the script contained in the HTML page.

I want to get all the selected element script like when we click on section then all the scripts contained in that section need to fetch.

Thanks in advance.

lock[bot] commented 4 years ago

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.