grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

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

Open raghuv9 opened this issue 7 years ago • 1 comments

Screenshot_20 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')); }, }

raghuv9 avatar Sep 12 '19 09:09 raghuv9

@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

artf avatar Sep 14 '19 19:09 artf