• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

get data(html format) from clipboard

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to get data from clipboard. I can use

window.clipboardData.getData('Text')

but it only get pure text from clipboard, how can I get the data with html format from clipboard?

Thanks,
Ping
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://msdn2.microsoft.com/en-us/library/ms535220.aspx

If you alert the value are you seeing the html tags? If yes, how are you setting the value to the page.

Eric
 
ping feng
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can not see any html tag when I alerted the value. I set the clipboard by Ctl-C. If I pasted the content to a world document, I can see the formated data.

I understand window.clipboardData.getData("Text") can only get pure text, but not sure if it's correct.

In the example: http://msdn2.microsoft.com/en-us/library/ms535220.aspx

I see it only set the clipboard with innerText -- window.clipboardData.setData("Text",oSource.innerText);

it's not a html format.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic