Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Copy link text to clipboard

Copy link text to clipboard

welo
11-23-2004, 10:44 PM
Hey folks :). I have a list of part numbers in tables I must dummy-proof, and need to get it so if people click that part number it gets copied to the clipboard. I have this but it only works in IE:

<html>
<head>
<script language="javascript">
function copy(value) {
bResult = window.clipboardData.setData("Text",value);
}
</script>
</head>
<body>
<a href=http://www.codingforums.com/archive/index.php/"#" title="1A1.6015A" onclick="copy(this.title);return false;">1A1.6015A</a>
</body>
</html>
Any ideas?

P.S. Don't tell me I need to start teaching people to C&P. I said this is dummy-proofing. :thumbsup:

sad69
11-24-2004, 01:02 AM
I found this link doing a quick google search:
http://www.gamedev.net/community/forums/topic.asp?topic_id=281951

Hope that helps,
Sadiq.

hemebond
11-24-2004, 01:04 AM
I have this but it only works in IE:That's because only Microsoft is stupid enough to allow a webpage to overwrite a users clipboard data.

codegoboom
11-24-2004, 01:20 AM
The fact is, anyone who doesn't want that to be allowed can change the security setting, and those that want it can benefit from the feature.

welo
11-24-2004, 01:56 AM
I found this link doing a quick google search:
http://www.gamedev.net/community/forums/topic.asp?topic_id=281951
Hey, thanks man. You must be a more gifted Google searcher for this stuff than I am, because I spent at least an hour trying to track it down and what I originally posted was as good as it got. Somebody on another board also drummed up this (http://www.krikkit.net/howto_javascript_copy_clipboard.html) too, so it seems between them something should be feasible.

Regardless, thanks for everything. :D

jbot
11-24-2004, 10:24 AM
The fact is, anyone who doesn't want that to be allowed can change the security setting, and those that want it can benefit from the feature.

they'd be pretty stoopit if they did: http://www.codingforums.com/showthread.php?t=46344&highlight=clipboard#post243664

codegoboom
11-24-2004, 12:32 PM
they'd be pretty stoopit if they did...
I disagree. Informed users are not "stoopit". :rolleyes:

jbot
11-24-2004, 01:51 PM
I disagree. Informed users are not "stoopit".

not entirely sure you properly understood my meaning, ie informed or not, allowing copy-and-paste operations via script opens your machine up to potential security threats. that's why this behaviour is blocked by default under SP2.

hemebond
11-24-2004, 08:23 PM
If these people can't select/copy text, I can't see them being able to edit their config or understanding any security messages.

This functionality is pointless and dangerous. Education is much better.

codegoboom
11-24-2004, 10:35 PM
The security option is set to "enable" by default, for all zones other than "Restricted sites".

The functionality is not pointless, it was designed for a purpose which is outlined here: About DHTML Data Transfer (http://msdn.microsoft.com/workshop/author/datatransfer/overview.asp)

Those who believe this poses a significant threat can change the setting. Because a feature can be hypothetically exploited by 'evil doers' doesn't mean everyone has to surrender their use of it... that's why it is optional.

sad69
11-24-2004, 11:04 PM
Those who believe this poses a significant threat can change the setting. Because a feature can be hypothetically exploited by 'evil doers' doesn't mean everyone has to surrender their use of it... that's why it is optional.

I can see this being a useful feature when building a Corporate Intranet Application where it is a controlled environment..

Sadiq.

jbot
11-24-2004, 11:58 PM
it is a relatively useful feature. that's why, like every other "feature", malware coders would be interested in it.


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

Problem with htmlarea
Random URL script help needed
Help with keystroke
possible to pass a form field name to a function, like this.value?
web forms proxy servers
List/menu link values
Need HELP on combo boxes

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics