将CKeditor内容(略大的内容)分配给变量时,接收未终止的字符串错误

I tried to create a onchange event in ckeditor and I succeed. For that while loading the editor I initialize the contents with setData method. Every thing is fine so far. But while loading contents, the variable which holds the editor contents seems to have problem with multi line character.Even though I assign quotes at the beginning and end of the string, only the first line gets quoted, while the remaining lines doesn't sometimes it works, sometimes it doesn't. LInk1 Link2

Meanwhile while assigning these values, while assigning these values

CKEDITOR.on('instanceCreated', function (e) {
    e.editor.on('instanceReady', function (ev) {
        if(this.id == 'cke_1')
        {
            set_data = '<?php echo ($esti); ?>';
            e.editor.setData(set_data);
        }
    });

enter image description here

The contents variable gets assigned like this. I tried with removing , replaced single quotes with ' Sometimes it works, sometimes it doesn't