0

I using ckeditor to post news and article in my website

I create a plugin function on post page (eg. post_news.php)

that plugin will foreach many images in a JQ dialog.

I want click one image will insert a image to ckeditor mouse cursor postion

< img src"abc.png">

Q1. How to... click a image in a dialog(not ck plugin) to insert a image html code to ckeditor mouse cursor postion

Q2. can I complete this action in the WYSIWYG mode?

Thanks a lot.

Sky
  • 157
  • 10

1 Answers1

1

Use editor.insertHtml( string ) to insert HTML at the position of the caret:

CKEDITOR.instances.editor1.insertHtml( '<img src="...">' );

And this question is where you'll find how to get the outer HTML of your image.

Community
  • 1
  • 1
oleq
  • 15,697
  • 1
  • 38
  • 65
  • like that? but not work :( – Sky Jul 11 '14 at 12:58