Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 28th, 2006, 11:55 PM
zakhirn@gmail.com
Guest
 
Posts: n/a
Default Copy ASP variable to clipboard using Javascript

Hello,

I have a search function that is reading companies from a database via
ASP and spitting out the results. I have various fields of each company
in variables and I want to be able to create a link that uses
Javascript to copy the address to the clipboard.

I know there is the javascript:window.clipboardData.getData(), but I
can't get to parse the ASP variable through. Does anyone know how I can
do this.

Thanks in advance.

  #2  
Old December 29th, 2006, 03:55 AM
McKirahan
Guest
 
Posts: n/a
Default Re: Copy ASP variable to clipboard using Javascript

<zakhirn@gmail.comwrote in message
news:1167349442.008063.269050@s34g2000cwa.googlegr oups.com...
Quote:
Hello,
>
I have a search function that is reading companies from a database via
ASP and spitting out the results. I have various fields of each company
in variables and I want to be able to create a link that uses
Javascript to copy the address to the clipboard.
>
I know there is the javascript:window.clipboardData.getData(), but I
can't get to parse the ASP variable through. Does anyone know how I can
do this.
To copy "to the clipboard" use "setData()" not "getData()".

Will this help?


<html>
<head>
<title>Clipper.asp</title>
<script type="text/javascript">
function clipper() {
var data = document.getElementById("Data").value;
alert("Clipboard = \n\n" + data);
window.clipboardData.setData("Text", data);
}
</script>
</head>
<body>
<span id="Data" value="<%=Now%>"></span>
To place the current date and time in the clipboard
<a href="javascript:clipper()">click here</a>.
</body>
</html>


  #3  
Old December 29th, 2006, 04:45 PM
zakhirn@gmail.com
Guest
 
Posts: n/a
Default Re: Copy ASP variable to clipboard using Javascript

Thats perfect....thanks a lot!

 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles