htmlView content selectable


#1

Hello everyone

Please, how can I make the content of a htmlView control selectable, for user to copy content and paste elsewhere?

Thanks


#2

Where does the content come from?


#4

The app generates a product description in html code, with information from a database and an image from a web server. I’d like to allow user to copy it.


#5

The text or the image?

Does the image come from another website? If so, you will run into Same-Origin issues.


#6

I’d like to make them both selectable, like a default web page.

Thanks for the SOP topic, having no trouble so far. I’m using Ajax/php and retrieving the image from a database.


#7

It sounds like you’re getting the image the right away to avoid SOP. Check the Chrome Debugger to be certain.

Are you having trouble selecting the text, the image or both?


#8

Having trouble selecting both.


#9

What control are you displaying them in?


#10

htmlView, property innerHTML


#11

I just tried a small test here. I created a new project with an HTMLview. I set the innerHTML:

    HTMLview1.innerHTML = "George Henne <img src='Alexandra.jpg'>"

I was able to select and copy the text and the image.

Does that work for you?