to all:我现在是想向一个在线编辑器(用iframe做的那种)中插入一段html代码,举个例子:如果直接用
clipboardData.setData("Text","test<br>test");将数据复制到剪贴板
用clipboardData.getData("text"),贴上去后是直接将html标记也显示出来了
成了这样
test<br>test
而不是我想要的
test
test
from MSDN (http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/setdata.asp?frame=true)
setData Method
Assigns data in a specified format to the dataTransfer or clipboardData object.
Syntax
bSuccess = object.setData(sDataFormat, sData)
Parameters
sDataFormat
Required. String that specifies the format of the data to be transferred, using one of the following values:
Text Transfers data formatted as text.
URL Transfers data formatted as a URL.
sData
Required. String that specifies the data supplied by the source object. This information can be descriptive text, a source path to an image, or a URL for an anchor. When you pass "URL" as the sDataFormat parameter, you must use the sData parameter to provide the location of the object being transferred.
sDataFormat Required.
String that specifies the format of the data to be transferred, using one of the following values:
Text Transfers data formatted as text.
URL Transfers data formatted as a URL.
sData Required.
String that specifies the data supplied by the source object. This information can be descriptive text, a source path to an image, or a URL for an anchor. When you pass "URL" as the sDataFormat parameter, you must use the sData parameter to provide the location of the object being transferred.
Return Value
Boolean. Returns one of the following possible values:
true The data was successfully added.
false The data was not added.
sDataFormat Required.
String that specifies the format of the data to be transferred, using one of the following values:
Text Transfers data formatted as text.
URL Transfers data formatted as a URL.
sData Required.
String that specifies the data supplied by the source object. This information can be descriptive text, a source path to an image, or a URL for an anchor. When you pass "URL" as the sDataFormat parameter, you must use the sData parameter to provide the location of the object being transferred.
Return Value
Boolean. Returns one of the following possible values:
true The data was successfully added.
false The data was not added.