Issue #898💬 AnsweredOpened February 26, 2018by NorthstarTech0 reactions

Editor.getHtml() outside the iframe of grapesjs.

Quick answerby alvim

You should get it by editor.getHtml(). If your editor is inside an iFrame and you're executing code in a parent window, you could access it like this: Is this what you're looking for?

Read full answer below ↓

Question

How should I get the getHtml() outside the grapesjs editor. I have a save button outside the iframe of editor. I am not getting the current html when I click the save button.

Help Needed.

Answers (3)

alvimFebruary 26, 2018

You should get it by editor.getHtml().

If your editor is inside an iFrame and you're executing code in a parent window, you could access it like this:

var indexOfIFrame = 0;
window.frames[indexOfIFrame].editor.getHtml()

Is this what you're looking for?

artfMarch 2, 2018

Sorry @NorthstarTech but I totally didn't get what you're talking about

JordanTGVGNovember 29, 2018

I have a issue in Edge browser, i cannot get the html from the editor with:

window.frames[indexOfIFrame].editor.getHtml()

in chrome and mozzila is working good, any ideas?

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.