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.
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
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:
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.
it is a relatively useful feature. that's why, like every other "feature", malware coders would be interested in it.