Forum Discussion

cike's avatar
cike
Champion
11 years ago

"Unterminated String literal" error when append component

Hey guys,

 

I'm trying to append a component (e.g. pagination) to my page using jQuery's append()-function:

 

$("mySelector").append('<@component id="common.widget.pager"/>');

 

But this piece of code causes a "SyntaxError: unterminated string literal" on my console.

I think the reason could be all the "\n" signs, which appear within the components code.

 

Is there an option or a workaround to append a component with the .append()-function?

 

Cheers,

Christian

11 Replies