Josh R
Josh R

Reputation: 1295

How to preview using execcommand in tinyMCE

I am using TinyMCE jquery plugin in my project. It works fine. I am trying to use exec command to view the preview. It is not working.

<a href="javascript:;"onclick="$('textarea.tinymce').tinymce().execCommand('Preview');">Preview</a>

But the same command for bold works fine.

I appreciate any help.

Thanks.

Upvotes: 2

Views: 3657

Answers (1)

Thariama
Thariama

Reputation: 50832

You are not using the right command. Try

$('textarea.tinymce').tinymce().execCommand('mcePreview');

Upvotes: 4

Related Questions