javascript copy link
Posted: Sun Oct 12, 2003 12:29 am
trying to make a link that will copy. not sure what's wrong. example link: http://24.91.157.113/findyourdesire/profile.php?un=neo
under the pictures, the link to this profile link.
here's the code for those that don't care to look (as sent to the browser from the php):
link:
javascript:
thanx in advance for any help, as you can see i do understand it will only work in ie once i get it working. testing in both M$IE and mozilla 1.3.1. i just want the confirm to come up in non-M$IE browsers (umm... 2 notes: one: i took care fo the // issue and two: even though i have the url, i don't have a host yet, so the link (created by php) isn't really working. (the one to the example does when the server is ON, and my rents have a tendancy to turn it off)
)
under the pictures, the link to this profile link.
here's the code for those that don't care to look (as sent to the browser from the php):
link:
Code: Select all
<li>Link Directly to this profile: <a name="#Neo" href="#Neo" onClick="toClipboard();">http://www.FindYourDesire//findyourdesire/profile.php?un=Neo</a></li>Code: Select all
<script language="javascript">
function toClipboard(){
var text="http://www.FindYourDesire//findyourdesire/profile.php?un=Neo";
var copyText=text.createTextRange();
return confirm("Do you want to copy the link http://www.FindYourDesire//findyourdesire/profile.php?un=Neo to your clipboard?
(this only works for M$IE");
copyText.execCommand("Copy");
alert("If using M$IE, then you have just copied the link, http://www.FindYourDesire//findyourdesire/profile.php?un=Neo to your clipboard.");
}
</script>