copying text to the windows clipboard using DHTML 
Author Message
 copying text to the windows clipboard using DHTML

I would like to be able to copy a bit of text to the windows clipboard when
the user clicks on an image.  Is it possible to do this using DHTML?

--
Darcy Fox
Agiliti, Incorporated
Minneapolis, MN



Sun, 03 Mar 2002 03:00:00 GMT  
 copying text to the windows clipboard using DHTML
Darcy,

This may get you started.

<snip src="MSDN" comment="jscript">

<HEAD>
<SCRIPT>
var sImageURL;

function InitiateDrag()
/*  The setData parameters tell the source object
   to transfer data as a URL and provide the path.  */
{  
    event.dataTransfer.setData("URL", oImage.src);

Quote:
}

function FinishDrag()
/*  The parameter passed to getData tells the target
    object what data format to expect.  */
{
    sImageURL = event.dataTransfer.getData("URL")
    oTarget.innerText = sImageURL;
Quote:
}

</SCRIPT>
</HEAD>
<BODY>

<P>This example demonstrates how to use the setData and
   getData methods of the dataTransfer object to enable the
   source path of the image to be dragged.</P>

<IMAGE ID=oImage SRC="/workshop/graphics/black.gif"
       ondragstart="InitiateDrag()">

<SPAN ID=oTarget ondragenter="FinishDrag()">
    Drop the image here
</SPAN>

</BODY>

</script>

Nic Roche
Net Extra
www.extra.net.au

Quote:

> I would like to be able to copy a bit of text to the windows clipboard when
> the user clicks on an image.  Is it possible to do this using DHTML?

> --
> Darcy Fox
> Agiliti, Incorporated
> Minneapolis, MN



Tue, 05 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB: Copy Text From DOS Window To Clipboard As Text

2. How to copy/paste a text to/from the Windows clipboard

3. Copying text of window to Clipboard

4. Copying text of window to Clipboard

5. Copying DBGrid contents to clipboard (Or copying a table from a Data component to clipboard)

6. Copying text to clipboard

7. Can a script copy text to the clipboard?

8. Copying text to clipboard

9. Copying text to clipboard

10. Auto copy highlighted text to clipboard

11. Can a script copy text to the clipboard?

12. How can i copy text to the clipboard in .vbs scripts

 

 
Powered by phpBB® Forum Software