How does copy to the clipboard?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'll guess that most people have used at some point.
When you click on's bookmarklet (see javascript below) to
obtain a short url,  you get a "Copy" button to copy the short url to
the clipboard.  I looked at the source and cannot determine how they
do this.  While the word "Copy" does not appear in the source, it easy
to narrow it down as to where one would think it would  be.

The short URL is prefaced by "Your link:" and the source is
following it is below:

            <h2>Your link:</h2>
            <div id="shortened_url_info">
              <input id="shortened-url" value=" " /
Quoted text here. Click to load it
              <span style="display:none;" id="short_url"> /
              <span id="index_copy_button"></span>

The lines following this go beyond the Copy button so the Copy button
must somehow be in this.  :)   Anyway, there's no sign of it.  I
checked the style IDs in the CSS but nothing was there either.  The
css is below.

#shorten-options #shortened-url
   display: block;
   float: left;
   margin-right: 4px;
   padding: 3px;
   background-color: #FEFFEC;
   border: 1px solid #999;
   width: 150px;
   font-size: 16px;

ul.history_actions li.short_url
   padding: 6px 0 0 6px;
   font-weight: bold;
   font-size: 1.2em;
   width: auto;


#index_copy_button object, #info_copy_button object
   vertical-align: text-bottom;

If anyone could give me a few pointers in figuring this out (or even
glaringly point out the obvious), I'd much appreciate it.


('%22'+enc(s)+'%22')),f=' /',l=d.location,p='?v=3&u='+enc

Re: How does copy to the clipboard?

Lao Ming wrote:
Quoted text here. Click to load it

The Copy button is a Flash object. Its working are inside Flash.

Internet Explorer JScript has clipboard copy functionality. I don't know
whether other browsers duplicate it.

Site Timeline