设置TinyMCE在线HTML编辑控件只读_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:31:20
Original
1923 people have browsed it

TinyMCE是一款主流在线HTML/Text编辑器,特定情况下需要设置成只读状态(比如用户访问权限受控时)。


有两种方法:一种是通过配置在控件初始化时设置,另外一种是运行时设置。

1. 通过配置在控件初始化时设置

tinyMCE.init({        ...        theme : "advanced",        readonly : 1});
Copy after login
2. 在运行时设置编辑器iframe body的contenteditable属性为false

tinymce.activeEditor.getBody().setAttribute('contenteditable', false);
Copy after login


by iefreer

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!