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

  • irach15's avatar
    irach15
    Maven
    9 years ago

    Hi cike,

    not yet :-)

    we have lots of custom code, so I'm writing myself ;-)

    However,

    I have many components plugged to another component via js strings and it seamed to be working ;-)