Issue #2265πŸ’¬ AnsweredOpened September 12, 2019by raghuv90 reactions

Able to fetch my local html file using load url and getting status ok how can i load this fetched url into editor currently im getting blank screen inside editor

Quick answerby artf

@raghuv9 please, read carefully this guide https://grapesjs.com/docs/modules/Storage.html#setup-the-server You can't just request a document page, you HAVE TO CREATE a server-side script which outputs a JSON in a CORRECT FORMAT. And please... write a more comprehensible title and format your code properly not just wit...

Read full answer below ↓

Question

Code SnippetTEXT
![Screenshot_20](https://user-images.githubusercontent.com/26516842/64770731-612bfb00-d56b-11e9-9d8c-a90115266e0f.png)
here is my code
 const LandingPage = {
                html: '',
                css: null,
                components: null,
                style: null,
                };
                this.editor = grapesjs.init({
                container: "#gjs",
                canvas: {
                     styles: [],
                },
                fromElement: true,
                components:'' ,
                style: '',
                plugins: [],
                pluginsOpts: {
                    "gjs-preset-webpage": {}
                },
                 storageManager: {
                    type: 'remote',
                    stepsBeforeSave: 10,
                    urlStore: 'http://laravel-vue-spa.test/userlogin',
                    urlLoad: 'http://laravel-vue-spa.test/userlogin',
                     params:{
                            'Access-Control-Allow-Origin':'http://laravel-vue-spa.test',
                        },
                    contentTypeJson: true,
                    headers: {
                        'Content-Type': 'application/json'
                     },
                     json_encode:{
                         'gjs-components': [],
                          'gjs-style': [],
                          "gjs-html": "",
                     }
                    },
                });
                this.editor.load=(res => console.log('Load callback'));
        },
    }

Answers (1)

artfβ€’ September 14, 2019

@raghuv9 please, read carefully this guide https://grapesjs.com/docs/modules/Storage.html#setup-the-server You can't just request a document page, you HAVE TO CREATE a server-side script which outputs a JSON in a CORRECT FORMAT.

And please... write a more comprehensible title and format your code properly not just with a copy/paste

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 β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.