Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-16-2007, 08:41 AM   PM User | #1
thepip3r
New Coder

 
Join Date: Mar 2005
Posts: 30
Thanks: 2
Thanked 0 Times in 0 Posts
thepip3r is an unknown quantity at this point
document.execCommand("Copy") - can it copy a passed variable?

I've tried a bunch of different variants but all of the posts on the web are for copying information from HTML forms. I want to copy something to the clipboard that I pass off of a hyperlink.
Code:
function copyToClipboard(x) {   
	if (x) 
             {
             alert(x);
	x.document.execCommand("Copy");
             }
}
Very rudimentary I know but when I click my hyperlink, "x" alerts fine. the message box holds the data i want it to. Now I just need help getting it copied to the clipboard. Is there any way I can just pass my varaible "x" to document.execCommand("Copy") ? If so, please elaborate.
thepip3r is offline   Reply With Quote
Old 02-21-2007, 10:41 AM   PM User | #2
thepip3r
New Coder

 
Join Date: Mar 2005
Posts: 30
Thanks: 2
Thanked 0 Times in 0 Posts
thepip3r is an unknown quantity at this point
bump.
thepip3r is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:51 AM.


Advertisement
Log in to turn off these ads.