繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> Microsofts Dynamic HTML Editing Component (DEC) 大家可以看一下

Microsofts Dynamic HTML Editing Component (DEC) 大家可以看一下

2006-06-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:Microsoft's Dynamic HTML Editing Component (DEC) November 1, 2001 There are actually two different ways you can accomplish HTML editing in IE5 and up. There is the MSHTML editor and then there's t...

Microsoft's Dynamic HTML Editing Component (DEC)

November 1, 2001

There are actually two different ways you can accomplish HTML editing in IE5 and up. There is the MSHTML editor and then there's the DHTML Editing Component. The MSHTML editor allows for WYSIWYG editing by defining "editable regions" of a page. The DEC on the other hand is an embedded ActiveX control that works much like a

You should now see the content from the textarea appear in the control! It's really easy then to go from here and pull the content from a database and input it into the control. You would just perform your database query and place the content into the textarea.

Example:

Let's say that the user has entered some content into the editing control and now wants to save the information to the database. We need to copy the content from the control back into our textarea to be submitted to our database. This is done in just the exact opposite way of putting the content into the control:

I've placed the code into a function that will get called when you go to submit the form to the database. To put it all together we get this:

DEC

CLASSID="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A" VIEWASTEXT

width="450" height="300">

You may notice in our final code a couple minor differences:

1. The code is now contained with the form tags and,

2. the reference to the editor has document.all attached to the front of it.

The code is contained within the form tags to make things easier to follow as we develop more code surrounding the editor. The editor is now referenced by document.all so that we can find the editor within the DOM. If you don't put document.all and the control is contained within form tags then you will get a JavaScript error.

So, we've discovered how to use the control and how to move content between the textarea and the control.

责任编辑:admin
相关文章