나는 몇 시간 동안 CLEditor를 사용하여 간단한 추가 작업을 수행했습니다. target = "_ blank"옵션을 추가 할 수 있습니다. 코드는 이것이다 :CLEditor - target = "_ blank"를 추가하십시오.
if (url != "") {
if ($("#blank").is(':checked')) {
editor.doc.execCommand("insertHTML", false, '<a href="' + url + '" target="_blank">' + selectedText(editor) + '</a>');
} else {
execCommand(editor, data.command, url, null, data.button);
}
// Reset the text, hide the popup and set focus
$text.val("http://");
hidePopups();
focus(editor);
}
가 아니라 저장 한 이상한 결함을 작품 - 내가 = "_ 빈"목표 링크 후 편집 가능한 영역을 클릭해야 저장 할 수 있도록 추가됩니다. 새로 추가 된 링크가 DOM에 있지만 볼 수 있습니다. 영역을 클릭하지 않으면 (아무 데나) - 저장할 수 없습니다.
execCommand (editor, data.command, url, null, data.button)에 target = "_ blank"가없는 링크가 삽입되는 동안 execCommand ("insertHTML"..)를 추가합니다. 그런 문제는 없습니다.
이러한 문제의 원인은 무엇입니까? PHP 부분없이
모든 일 : 적절한 답변으로 어쨌든 간주 될 수 없다 https://jsfiddle.net/rzj0f334/