没有html这个参数:

Text,URL 

解决方案 »

  1.   

    SyntaxbSuccess = object.setData(sDataFormat, sData)ParameterssDataFormat 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 ValueBoolean. Returns one of the following possible values:true The data was successfully added. 
    false The data was not added. 
      

  2.   

    SyntaxbSuccess = object.setData(sDataFormat, sData)ParameterssDataFormat 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 ValueBoolean. Returns one of the following possible values:true The data was successfully added. 
    false The data was not added. 
      

  3.   

    可我看的那本《javascript宝典》(电子工业出版社译,99元)
    上面说:
    setData(format,data)
    返回值Boolean
    存储字符串数据格式是以下之一:Text,URL,File,HTML,Image。对非文本数据格式,数据必须是字符串,它必须指定到当前内容的路径或者URL。
    原来感觉这本书还不错,怎么犯这种错误?要不就是我理解错了,到底怎么回事?
      

  4.   

    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.SyntaxbSuccess = object.setData(sDataFormat, sData)ParameterssDataFormat 
    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.  
      

  5.   

    Text,URL,File,HTML,Image好东西,不过对于IE来说,只支持 Text,URL如果来自外部程序的,可以直接使用 paste 方法,对 Image ,HTML 有效
      

  6.   

    to:linhaibo(美洲豹): paste 方法?他是哪个对象的方法?能举个例子吗?to all:我现在是想向一个在线编辑器(用iframe做的那种)中插入一段html代码,举个例子:如果直接用
    clipboardData.setData("Text","test<br>test");将数据复制到剪贴板
    用clipboardData.getData("text"),贴上去后是直接将html标记也显示出来了
    成了这样
    test<br>test
    而不是我想要的
    test
    test该怎么办?
      

  7.   

    <br>可以用\n
    可我只是举个例子,我实际想插入的是
    <img src="aaa.jpg" alt="gggg" align="left">
    这怎么办?
      

  8.   

    你说的那些参数是别的应用程序支持的,比如/:interdav,dreamweaver等
      

  9.   

    <iframe id=demo src="about:<body>hi,test"></iframe>
    <input type=button onclick=addImage() value=addImage>
    <script>
    function addImage(){
    demo.document.body.innerHTML+='<img src="aaa.jpg" alt="gggg" align="left">'
    }
    demo.document.designMode="on"
    </script>
      

  10.   

    别up了,呵呵,看看
    http://www.blueidea.com/bbs/newsdetail.asp?id=461596
    就会明白的
    <iframe id=demo src="about:<body>hi,test"></iframe>
    <input type=button onclick=addImage() value=addImage>
    <script>
    function addImage(){
    var html='<img src="aaa.jpg" alt="gggg" align="left">'
    demo.focus();
    demo.document.selection.createRange().pasteHTML(html)
    }
    demo.document.designMode="on"
    </script>
      

  11.   

    高!
    demo.focus();
    就是没想出用这个来~~~~~~~~