designMode

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-12 07:12:42

软件介绍

Cross-browser designMode

What is designMode?

Almost all major browsers offer a de facto support for rich text editing, which makes an entire DOM document editable. It was originally developed for Internet Explorer, however, later implementations by other browsers are proven to be surprisingly compatible and stable. The functions in this plugin can help you turn any frame, iframe or window into a cross-browser wysiwyg editor.

This technique can be referred to as designMode, because it's triggered by setting the designMode property of a DOM document to 'on' using JavaScript. The content can be modified by a set of commands using the execCommand() function. Mozilla provides a good specification of avalible commands.

What this plugin does

There are some browser differences related to designMode. This plugin handles such stuff in a cross-browser way, combined with the flexibility of jQuery.

Although complete wysiwyg editors require lots of work, this plugin provides the very basic functionality to be used as a part of something more advanced.

At least the following browsers have full or limited support for designMode:

  • Internet Explorer 6+
  • Firefox 1.5+
  • Safari 1.3+
  • Opera 9+

There are three jQuery functions to be used on any frame, iframe or window:

  • contentDocument() - access the DOM document of an element.
  • designMode() - set the designMode property. Chaining supported.
  • execCommand() - execute designMode commands. Chaining supported.

Examples

In these examples, #foo is either a frame, iframe or window (created by window.open for instance).

$(window).designMode('on') //Activate designMode of current page
$('#foo').designMode(); //Mode is optional, defaults to 'on'
$('#foo').execCommand('formatblock', '<p>'); //Execute command, with optional parameter
$('#foo').designMode().execCommand('bold'); //Chaining: Activate + execute
var doc = $('#foo').contentDocument(); //Access the DOM document

本文地址:https://codercto.com/soft/d/23193.html

Web全栈工程师的自我修养

Web全栈工程师的自我修养

余果 / 人民邮电出版社 / 2015-9-1 / 49.00

全栈工程师正成为 IT 行业的新秀,论是上市互联网公司还是创业公司,都对全栈工程师青睐有加。本书作者是腾讯公司高级工程师,在前端、后端和APP开发方面都有丰富的经验,在本书中分享了全栈工程师的技能要求、核心竞争力、未来发展方向、对移动端的思考。除此之外,本书还详细记录了作者从零开始、学习成长的心路历程。 本书内容全面,客观务实,适合互联网行业新人、程序员,以及期待技术转型的从业者阅读参考。一起来看看 《Web全栈工程师的自我修养》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具