Issue #555Opened November 22, 2017by HarshOB2 reactions

Add external script in script while creating new component

Question

Hello @artf

How can I pass external script link while creating a component? like this way,

bm.add('test-block2', { label: 'Test block2', attributes: {class: 'fa fa-text'}, content: { script: '<script src="https://cdn.ckeditor.com/4.6.2/full/ckeditor.js"></script>CKEDITOR.replace( \'editor1\' )', content: '<textarea name="editor1"></textarea>' } });

Right now it shows error like unexpected token '<'

Answers (3)

arthuralmeidapNovember 22, 20170 reactions

Move the script tag to import CKEditor on the html page and just call the script inside the block.

rohanreddygFebruary 4, 20180 reactions

javascript somehow not allowing script end tag ("</script>") with in string. So just change the code to be like: script: '<script>alert("Hi");<' + '/script>'

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.